PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET RE: Adding DataTables from two different datasets

Reply

RE: Adding DataTables from two different datasets

 
Thread Tools Rate Thread
Old 16-05-2005, 12:22 PM   #1
=?Utf-8?B?UmF2aWNoYW5kcmFuIEouVi4=?=
Guest
 
Posts: n/a
Default RE: Adding DataTables from two different datasets


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>
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off