Skip to content

Moving data between 2 different MySQL databases using a module

Frank

Asked Feb 14, 2008, 5:23 AM EST2 answers
Share
LinkedInX

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

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mahesh Chand
    0

    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.

    0
  • 0

    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

    0