|
NextResult moves the data reader on to the next result set, not the next row. Read moves the reader to the next row until it gets to the last row in the current result set.
|
|
|
|
|
Thank you for the reply. I found a way to work with the IDataReader that I am getting back so there is no need to convert it.
Appreciate the time on this though, enjoy your day.
Steve Welborn
Software Engineer
BitWise Solutions
|
|
|
|
|
I would like to create different versions of a program, but I'm not sure how to achieve that in VS2005. I've looked at configurations and conditional compilation, but I haven't found anything that works yet.
Here's what I would like to do:
I need three versions of a program:
Version 1
=========
* Contains a user interface for analysing data
* Contains code and a user control for talking
to an electric motor, also contains a dll
that does the low level communication with
the electric motor.
This version would be installed on computers that have the electric motor attached.
Version 2
=========
* Contains only the user interface for analysing
data
This version would be installed on computers that don't have the electric motor installed. They would therefore also not have the dll and not need the user control for talking to the motor.
Version 3
=========
* Contains a simplified user interface for displaying results of the analysis.
What's the best way to achieve having these separate versions?
Thanks for your help.
|
|
|
|
|
Why not have several project in the same solution. Each sharing the source code for the items each version needs.
|
|
|
|
|
Thanks for your answer.
The reason, why I would like to avoid it is this: When I add a new source file to one of the projects, I have to add it to all projects, in case it is needed there. That is fine with a small project, but this one will over time get rather large and I want to keep maintenance of different versions to a minimum.
|
|
|
|
|
Conditional compilation is for small changes between different versions of the same assembly - e.g. DEBUG vs. RELEASE or excluding some features in a compact framework build.
You should create separate libraries for each module of your program and create three .exe files that use the libraries required for that version.
|
|
|
|
|
i want code for authentication's to connect remote computer and accessing the files in remote computer. Code in C# with windows app if possible
this is haneef
|
|
|
|
|
What have you done so far?
|
|
|
|
|
the following code for backup a database stadard form of zip file.
it is working properly for c# with windows app but not C# with asp. why i don't know.
in c# with windows also one problem it is not connecting to remote server database.
using System.Data.SqlClient;
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using SQLDMO;
using System.IO;
using System.Diagnostics;
using Shell32;
using System.Xml;
using System.Security.Permissions;
using System.Configuration;
namespace backup1
{
///
/// Summary description for WebForm1.
///
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.TextBox TextBox2;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Label Label4;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.TextBox t1;
protected System.Web.UI.WebControls.TextBox t2;
protected System.Web.UI.WebControls.ListBox ListBox1;
protected System.Web.UI.WebControls.ListBox lb;
protected System.Web.UI.WebControls.Button Button1;
private void Page_Load(object sender, System.EventArgs e)
{
/*SQLDMO.Application oSQLServerDMOApp = new SQLDMO.Application();
SQLDMO.NameList oNameList;
oNameList = oSQLServerDMOApp.ListAvailableSQLServers();
for (int intIndex = 0; intIndex <= oNameList.Count - 1; intIndex++)
{
if (oNameList.Item(intIndex as object) != null)
{
lb.Items.Add(oNameList.Item(intIndex).ToString());
}
}
if (lb.Items.Count > 0)
lb.SelectedIndex = 0;
else
lb.Items.Add("(local)");*/
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Button2.Click += new System.EventHandler(this.Button2_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Button2_Click(object sender, System.EventArgs e)
{
string s="";
string con="";
string del2="";
string s1="";
string del1="";
int len1=0;
string k="";
string temp="";
string database1="";
string temp1="";
try
{
Login2Class s12=new Login2Class();
SQLServer2Class server = new SQLServer2Class();
Databases databases;
Database2 database;
Backup2Class backup = new Backup2Class();
//SqlConnection con11=new SqlConnection("user id=sa ; password=sa123; data source=192.168.1.6; database=pubs");
//con11.Open();
server.LoginSecure = true;
server.Connect("192.168.1.6" ,"administrator" ,"");
databases = server.Databases;
database1=t1.Text;
database = (Database2) databases.Item(database1, null);
backup.PercentCompleteNotification = 1;
backup.Database = database.Name;
int len=0;
s=TextBox2.Text;
if(s.ToUpper().EndsWith(".BAK") == true)
{
len1=s.Length;
s=s.Substring(0,len);
}
System.IO.Directory.CreateDirectory(s);
temp= System.IO.Directory.CreateDirectory(s).ToString();
s=s+"\\"+temp;
try
{
if(s.ToUpper().EndsWith(".BAK") == false)
{
s += ".bak";
}
del2=s;
backup.Files = s;
temp1=s;
backup.SQLBackup(server);
server.DisConnect();
backup = null;
server = null;
}//try
catch(Exception ex)
{
Response.Write(ex.ToString());
}
s1=s;
con="\\"+temp+".bak";
if(s1.EndsWith(con)==true)
{
len1=s1.IndexOf(con);
k=s1.Substring(0,len1);
}
con=temp+".bak";
if(s1.EndsWith(con)==true)
{
len1=s1.IndexOf(con);
s1=s1.Substring(0,len1-1);
}
del1=s1;
if(s.ToUpper().EndsWith(".ZIP") == false)
{
s1 += ".zip";
}
byte[] emptyzip = new byte[] {80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
FileStream fs= File.Create(s1);
fs.Write(emptyzip, 0, emptyzip.Length);
fs.Flush();
fs.Close();
fs = null;
//Copy a folder and its contents into the newly created zip file
Shell32.ShellClass sc = new Shell32.ShellClass();
Shell32.Folder SrcFlder = sc.NameSpace(k);
Shell32.Folder DestFlder = sc.NameSpace(s1);
Shell32.FolderItems items = SrcFlder.Items();
DestFlder.CopyHere(items, 0);
int i=DestFlder.Items().Count;
while(items.Count >= i)
{
System.Threading.Thread.Sleep(1000);
}
System.Threading.Thread.Sleep(1000);
System.Threading.Thread.Sleep(1000);
System.Threading.Thread.Sleep(1000);
System.IO.File.Delete(del2);
System.IO.Directory.Delete(del1);
Response.Write("zip file created in location ::" + s1);
}//try
catch(System.Runtime.InteropServices.COMException ex)
{
Response.Write(ex.ToString());
}
catch(System.Exception ex)
{
Response.Write(ex.ToString());
}
}
}
}
this is haneef
|
|
|
|
|
I am having a tabcontrol.Tab pages are added to it dynamically.Tab pages are type of "Form". On that form i am dragging a control.On the drag over event i get the e.X & e.Y position (screen coordinates).When i convert to Client coordinates i dont get the exact dropped location for control.
Like 1 big rectangle(tab page) with embedded small rectangle(Form).When control is dragged in small rectangle(Form) i dont get exact location.When i drag control to 0,0 position of small rectangle(Form) i get some other value(42,136).
Can anyone help me.Thanks in advance.
|
|
|
|
|
hi i am just wondering if there is a way to query a datatable so as to find out if there is a row whos date exists between 2 specified dates and if so where wud i be able to read an intro to thi thanks in advance
tim
|
|
|
|
|
|
Yes. You can use the DataView class. Set the rowfilter = "field > " + date.toshortstring " + " and " + "field < " + date.toshortstring
Check you help files for the exact syntax, I'm just going from memory.
|
|
|
|
|
ok thanks alot folks
worked perfectly and in about one fifth of the time thanks alot
|
|
|
|
|
How Can I Make Setup File In C#.NET 2003 including The database files
just to run automaticly on other pc's .
|
|
|
|
|
kifahhk wrote: How Can I Make Setup File In C#.NET 2003
Gee I don't know... hey maybe with a Setup and Deployment Project?
led mike
|
|
|
|
|
Stop, it can't be that easy
I'm sure he looked everywhere before posting
|
|
|
|
|
the subject is self-explanatory
|
|
|
|
|
I'm sure you scoured this site and found nothing
But, here's one:
http://www.codeproject.com/dotnet/Auto_Increment_Version.asp
|
|
|
|
|
|
I would like to know how can i pass a table to Hibernate automatically in Net 1.1. That is a neeed a software to generate DTO y DAO.
|
|
|
|
|
Hello,
I am looking for a solution to synchronize multiple Exchange-Calendars
with my SQL-Database.
Is there anyone who can tell my a way to solve this problem?
I am using Visual Studio 2005 .NET and MS Office 2003. I tried several
ways but I didn´t get a solution.
Thanks John
|
|
|
|
|
What have you got so far?
|
|
|
|
|
I have a
class myButton:Button
{
myButton(object obj)
{
//...
}
protected void override OnPaint(PaintEventArgs ev)
{
// code
}
}
What i want:
I have a form with a simple button.
When i enter the event_click this button i create a myButton control object that i want to be drawn somewhere on the form.
The reason why i need a custom control is that i want the myButton obj to contain the object that i send to the constructor.
How do i draw this button to the form, what do i call and so forth?
The properties i want to set for this myButton is that it is flat for now..
To this myButton i want to register the double_click event.
Have searched the internet but i am a bit confused, i thought i understood but nothing draws.
Please som help!
|
|
|
|
|
babbelfisken wrote: protected void override OnPaint(PaintEventArgs ev)
{
// code
}
}
You'll be wanting to look at ev.Graphics - the Graphics object. This will allow you to manually draw the button. For example:
ev.Graphics.DrawRectangle(Pens.Black, this.ClientRectangle);
But it gets more complex - double buffering, multiple states (enabled, disabled etc..).
Is that a good starting point?
Eitsop
|
|
|
|