Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loading DataTables in a strongly typed DataSet
Message
From
02/02/2004 10:27:54
 
 
To
02/02/2004 08:41:31
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00872899
Message ID:
00872955
Views:
22
Is it possible to load data into the datatables using the same stored procedure or do I need to load each datatable separately?

Rex,

Yes, you can use the same SP to load the data. Just use DataAdapter.Fill(MyDataSet) as you would for loading data into any dataset. Just be sure that the SqlCommand is the name of your SP. Something like this:
SqlCommand sc = new SqlCommand("MySP", this.MyConnection);
sc.CommandType = CommandType.StoredProcedure;
sc.Parameters.Add("@MyPK", MyPKValue);
SqlDataAdapter da = new SqlDataAdapter(sc);

da.Fill(MyDataSet);
~~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