Copying one dataset to another

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ladies and Gentlemen,

I need to transfer some data from Access accross to a table in SQL. I would
use DTS except Im am using the Express version of SQL.

I have set up 2 datasets in visual studio and would like to copy the data
from one dataset to another.

I have tried importrow but this does not update the table for some reason!

Please, please, please help?
 
Hi Chris,

Not sure if the clone method will work. This just creates a copy of the
dataset. I have two datasets that are identical - one has data from an
Access database the other has no data from a SQL database. I want to
populate the SQL database with the Access data. I have two data grids on a
form for each of the datasets. By using importrow (as below) I am able to
copy the data to the other datagrid but for some strange reason the data wont
save?

Weird!!!


DataRow[] copyRows = custDS.Tables["Customers"].Select("Country = 'Germany'");

DataTable custTable = custGermanyDS.Tables["Customers"];

foreach (DataRow copyRow in copyRows)
custTable.ImportRow(copyRow);
 
No therefore gave Chris you probably another link which shows the copy
method.

As he had not done it, than I had done it.

Cor

bh said:
Hi Chris,

Not sure if the clone method will work. This just creates a copy of the
dataset. I have two datasets that are identical - one has data from an
Access database the other has no data from a SQL database. I want to
populate the SQL database with the Access data. I have two data grids on
a
form for each of the datasets. By using importrow (as below) I am able to
copy the data to the other datagrid but for some strange reason the data
wont
save?

Weird!!!


DataRow[] copyRows = custDS.Tables["Customers"].Select("Country =
'Germany'");

DataTable custTable = custGermanyDS.Tables["Customers"];

foreach (DataRow copyRow in copyRows)
custTable.ImportRow(copyRow);

Chris said:
 
Still no joy!! I can see the data pass accross to the datagrid but it wont
save the changes to the sql table!


Cor Ligthert said:
No therefore gave Chris you probably another link which shows the copy
method.

As he had not done it, than I had done it.

Cor

bh said:
Hi Chris,

Not sure if the clone method will work. This just creates a copy of the
dataset. I have two datasets that are identical - one has data from an
Access database the other has no data from a SQL database. I want to
populate the SQL database with the Access data. I have two data grids on
a
form for each of the datasets. By using importrow (as below) I am able to
copy the data to the other datagrid but for some strange reason the data
wont
save?

Weird!!!


DataRow[] copyRows = custDS.Tables["Customers"].Select("Country =
'Germany'");

DataTable custTable = custGermanyDS.Tables["Customers"];

foreach (DataRow copyRow in copyRows)
custTable.ImportRow(copyRow);

Chris said:
Check this out.
http://msdn.microsoft.com/library/d.../cpguide/html/cpconcopyingdatasetcontents.asp

:

Ladies and Gentlemen,

I need to transfer some data from Access accross to a table in SQL. I
would
use DTS except Im am using the Express version of SQL.

I have set up 2 datasets in visual studio and would like to copy the
data
from one dataset to another.

I have tried importrow but this does not update the table for some
reason!

Please, please, please help?
 
Back
Top