Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# replacement for VFP code
Message
From
03/12/2006 00:17:34
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01167122
Message ID:
01174442
Views:
19
Jojo,

>If thats the case, then I think I had mis-understood the book I have about datasets?

Either that or the author of the book doesn't have a clue! <g>

>BTW, I think there is a difference between a datasets created with Delphi/Interbase and C#/VB.NET/MS SQL. But to conclude on this, I have to finish exporting Interbase Tables into VFP tables, strip duplicate data and migrate/upsize to SQL Server 2005. I'll post the difference if really has.

No, the DataSet wouldn't be any different. A DataSet is a DataSet. It doesn't matter where the data comes from. Here's a little snippet for retrieving a DataSet from a SqlServer database:
public DataSet GetMyData()
{
	string TestConnection = "server=(local);database=MyDataBase;uid=sa;pwd=MyPassword";
	SqlDataAdapter da = new SqlDataAdapter("select * from bob", this.TestConnection);
	DataSet ds = new DataSet();
	da.Fill(ds, "MyTable");

	return ds;
}
Now, if you weren't using SqlServer, you'd use the proper connection string for the other kind of database, plus you'd use the OleDbDataAdapter instead of the SqlDataAdapter:
public DataSet GetMyData()
{
	string TestConnection = "MyDelphiConnectionString";
	OleDbDataAdapter da = new OleDbDataAdapter("select * from bob", this.TestConnection);
	DataSet ds = new DataSet();
	da.Fill(ds, "MyTable");

	return ds;
}
In either case, the DataSet object remains the same ... same DataSet, same DataTables, same DataRows ... only the data itself will be different.

How was it explained in your book?

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform