467,911 Members | 1,553 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,911 developers. It's quick & easy.

Copy one dataset data into another problem

Mo
Hi,

I have two datasets on two databases one remote and one local. I am
trying to copy the local data into the remote. Both tables have the
same structure. I use the following

DataTable Remote_Table = new DataTable();
Remote_Table = dsRemote.Tables[0].Clone();
DataRow[] DR_Local = dsLocal.Tables[0].Select();
foreach(DataRow Local_Data in(DR_Local))
{
Remote_Table.ImportRow(Local_Data);
}
Remote_Table.LoadDataRow(DR_Local, true);
I endup with the following error:
Input array is longer than the number of columns in this table
on the last line! Any ideas out there?

Thanks

May 28 '06 #1
  • viewed: 3871
Share:
1 Reply
> DataTable Remote_Table = new DataTable();
Remote_Table = dsRemote.Tables[0].Clone();
DataRow[] DR_Local = dsLocal.Tables[0].Select();


Try:
DataTable Remote_Table = dsRemote.Tables[0].Clone();
foreach(DataRow row in dsLocal.Tables[0].Rows)
{
Remote_Table.ImportRow(row);
}

btw, which line generates that error?
--
Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
http://www.edujini.in
http://webservices.edujini.in
-------------------
May 28 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

42 posts views Thread by Edward Diener | last post: by
4 posts views Thread by Steve Donnor | last post: by
1 post views Thread by Jeroen Pot | last post: by
7 posts views Thread by lgbjr | last post: by
4 posts views Thread by JIM.H. | last post: by
4 posts views Thread by Al | last post: by
4 posts views Thread by Soulless | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.