Nov 18, 2002 #1 G gqstud79 Member Joined Sep 28, 2002 Messages 11 Can anyone tell me how to add multiple tables to a dataset? Im having all kinds of problems trying to figure it out. Thanks Last edited by a moderator: Nov 18, 2002
Can anyone tell me how to add multiple tables to a dataset? Im having all kinds of problems trying to figure it out. Thanks
Nov 18, 2002 #2 Bucky Well-known member Joined Dec 23, 2001 Messages 791 Location East Coast User Rank *Expert* First you need to create a new table to add, then all you need to do is add that table to the DataSets Tables collection, using its add method. Here ds is the dataset: Code: Dim dtMoo As New DataTable("Moo") ds.Tables.Add(dtMoo) Then dtMoo will be one of the DataSets tables, and you can access it by an index, its name, or the DataTable instance itself (dtMoo). You can add as more tables to the DS using this same method. [edit]Fixed up some stuff[/edit]
First you need to create a new table to add, then all you need to do is add that table to the DataSets Tables collection, using its add method. Here ds is the dataset: Code: Dim dtMoo As New DataTable("Moo") ds.Tables.Add(dtMoo) Then dtMoo will be one of the DataSets tables, and you can access it by an index, its name, or the DataTable instance itself (dtMoo). You can add as more tables to the DS using this same method. [edit]Fixed up some stuff[/edit]
Jan 13, 2009 #3 R robertsams23 Member Joined Mar 28, 2008 Messages 15 multiple tables in dataset , click the following link http://vb.net-informations.com/dataset/dataset-multiple-tables-sqlserver.htm robert.
multiple tables in dataset , click the following link http://vb.net-informations.com/dataset/dataset-multiple-tables-sqlserver.htm robert.