adding a data table to a dataset 
Author Message
 adding a data table to a dataset

Lets say we i have 2 datasets - Dataset1 and Dataset2. Is it possible that
the datatable of Dataset2, is added as another table of Dataset1?

I tired to do it this way , but it gives me an error saying that the
datatable already belongs to a dataset. Here is what i tried:
Dim oMyDataTable As DataTable = oDataSet2.Tables(0)

oDataSet1.Tables.Add(oMyDataTable)

oOutstandingBalancesDS.AcceptChanges()

<<<<<

Is there any other alternate way of combining 2 tables returned from 2
different datasets ?

Thanks
Jyotsna



Tue, 26 Apr 2005 19:00:02 GMT  
 adding a data table to a dataset
Instead of adding the table to the second dataset, try to merge it.
This help topic has more info on merge.
ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconmergingdatasetcontents.htm
-Ed
Visual Basic Test Team
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> Lets say we i have 2 datasets - Dataset1 and Dataset2. Is it possible that
> the datatable of Dataset2, is added as another table of Dataset1?

> I tired to do it this way , but it gives me an error saying that the
> datatable already belongs to a dataset. Here is what i tried:

> Dim oMyDataTable As DataTable = oDataSet2.Tables(0)

> oDataSet1.Tables.Add(oMyDataTable)

> oOutstandingBalancesDS.AcceptChanges()

> <<<<<

> Is there any other alternate way of combining 2 tables returned from 2
> different datasets ?

> Thanks
> Jyotsna



Wed, 27 Apr 2005 05:09:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Adding new rows to related tables on a dataset

2. Adding information to a Table via a Dataset

3. Adding a Relationship between Tables (ADO.NET Dataset)

4. Adding data manually to a DataSet

5. Adding data to table through Recordsets

6. Add data to Table - Tim is helping me!

7. Code to add data to a table

8. Add data from form into a table

9. DAO - Add Data Directly to Table

10. add data to table using variables declared in modules

11. Using module to add data to table

12. how to add data in table through scrolled list

 

 
Powered by phpBB® Forum Software