hello,
Im trying to move data between a source database and a target database, both databases are on different locations, so i made 2 connection strings.
this is what i have so far:
//removed all the declarations!
Sourceadapter.Fill(SourceDataset)
SourcaDatatable = SourceDataset.Tables(0)
targetdataset = SourceDataset
targetdatatable = SourceDataset.Tables(0)
targetadapter.Update(SourceDataset.Tables(0))
i have made a for loop to test the out put:
For Each targetDatarow In targetdatatable.Rows
Console.WriteLine(targetDatarow("event_id"))
Next
how do i get the data in the target database, im trying to copy 16 tables like this, after that it needs to go row by row on a fixed period..
has anyone got a clue?
thanks in advance
greetz Frank
Mahesh ChandRank #1 · 392.9K pointsPosted Feb 14, 2008, 7:38 AM EST
I think it will be faster for you to copy data from one database to another using "INSERT INTO .. FROM ...." SQL query than looping thorugh the DataSet rows.
Frank3 pointsPosted Feb 14, 2008, 9:59 PM EST
thanks for your repley, can you please elaborate on it a bit more?
do you mean like using a datareader and use those values to do the inserts?
greetz Frank