Hi

How to pass the content of one data table to another data table.I simply
tried using assignment operator...Example: datatable1=datatable2...But,its
not working..

ravindra

Re: About datatables by Miha

Miha
Fri Dec 30 03:37:43 CST 2005

Use DataTable.Merge method

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Ravindra" <ravindra@nannacomputers.com> wrote in message
news:Os6aH$RDGHA.208@tk2msftngp13.phx.gbl...
> Hi
>
> How to pass the content of one data table to another data table.I simply
> tried using assignment operator...Example: datatable1=datatable2...But,its
> not working..
>
> ravindra
>
>
>
>
>
>



Re: About datatables by Cor

Cor
Fri Dec 30 03:47:57 CST 2005

Ravindra,

>
> How to pass the content of one data table to another data table.I simply
> tried using assignment operator...Example: datatable1=datatable2...But,its
> not working..
>
It depends what you want, if you want a copy of datatable2 in datatable1 one
than you can use the DataTable.copy command. What you are doing now is
setting the reference of datatable2 to datatable1 as well.

If you want the content to be copied than

datatable1 = datatable2.copy

I hope this helps,

Cor



Re: About datatables by Ravindra

Ravindra
Fri Dec 30 03:49:46 CST 2005

yeah we used merge method, but the error "merge is not a method of
system.data.datatable" occured.
"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:%23UEpwSSDGHA.2436@TK2MSFTNGP15.phx.gbl...
> Use DataTable.Merge method
>
> --
> Miha Markic [MVP C#]
> RightHand .NET consulting & development www.rthand.com
> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>
> "Ravindra" <ravindra@nannacomputers.com> wrote in message
> news:Os6aH$RDGHA.208@tk2msftngp13.phx.gbl...
>> Hi
>>
>> How to pass the content of one data table to another data table.I simply
>> tried using assignment operator...Example:
>> datatable1=datatable2...But,its not working..
>>
>> ravindra
>>
>>
>>
>>
>>
>>
>
>



Re: About datatables by Skanda

Skanda
Fri Dec 30 06:21:29 CST 2005

I think the DataTable.Merge works on the 2.0 Framework?

I think in your case, you can enumerate the rows and use the
LoadDataRow method of the Datatable.


Re: About datatables by Skanda

Skanda
Fri Dec 30 06:22:45 CST 2005

I think the DataTable.Merge works on the 2.0 Framework?

I think in your case, you can enumerate the rows and use the
LoadDataRow method of the Datatable.


Re: About datatables by Miha

Miha
Fri Dec 30 07:20:42 CST 2005


"Skanda Subramanian" <skandy.sub@gmail.com> wrote in message
news:1135945289.465120.189350@g47g2000cwa.googlegroups.com...
>I think the DataTable.Merge works on the 2.0 Framework?

Right, is anybody still using .net 1.x? ;-)
>
> I think in your case, you can enumerate the rows and use the
> LoadDataRow method of the Datatable.

Or put datatables into a dataset, make sure that both have same name and do
a DataSet.Merge

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

>