PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
RE: Adding DataTables from two different datasets
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
RE: Adding DataTables from two different datasets
![]() |
RE: Adding DataTables from two different datasets |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
ds.Tables.Add(dt);
ds.Tables.Add(dt1); where dt and dt1 are two DataTable objects. with regards, J.V. "Prarthana Padbidri via .NET 247" wrote: > Hi, > I have two datasets, with one table each. I need to combine them in a single dataset before returning the dataset. > I tried the following: > Dim ds As New DataSet() > ds.Tables.Add(0) > ds.Tables.Add(1) > ds.Tables(0) = ds1.tables(0).Copy() > ds.Tables(1) = ds2.tables(0).Copy() > > But it gives a build error : "Property 'Item' is ReadOnly > > ds.Tables.Add(ds1.Tables(0).Copy) > ds.Tables.Add(ds2.Tables(0).Copy) > > This gives an error: "Table already exist as a part of another dataset" > > Please Help. > Thanks > > -------------------------------- > From: Prarthana Padbidri > > ----------------------- > Posted by a user from .NET 247 (http://www.dotnet247.com/) > > <Id>lmEFDFHLOESvWXleDhzjBg==</Id> > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

