Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Loading DataTables in a strongly typed DataSet
Message
De
02/02/2004 10:27:54
 
 
À
02/02/2004 08:41:31
Rex Mahel
Realm Software, Llc
Ohio, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00872899
Message ID:
00872955
Vues:
23
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform