Hi
I have 2 databases with the same structure.
I have filled the 1st dt up with contents of the local db and the 2nd dt with content of the remote db.
I have used dt1.merge(dt2) hoping that i would get a dt1 with all the changes and new rows from dt2 and i could do a da.update(dt1) to commit the changes to db.
At the moment dt1 is empty and dt2 has 4 records. When the 4 records get copied to dt1 the rowstate of them all is unchanged. I was hoping this would be 'added' and would then would then insert to the db.
How can I achieve this behaviour please?
Is a case of having to manually set the rowstate in dt1 for all the dt2 extras rows?
Thanks
I have 2 databases with the same structure.
I have filled the 1st dt up with contents of the local db and the 2nd dt with content of the remote db.
I have used dt1.merge(dt2) hoping that i would get a dt1 with all the changes and new rows from dt2 and i could do a da.update(dt1) to commit the changes to db.
At the moment dt1 is empty and dt2 has 4 records. When the 4 records get copied to dt1 the rowstate of them all is unchanged. I was hoping this would be 'added' and would then would then insert to the db.
How can I achieve this behaviour please?
Is a case of having to manually set the rowstate in dt1 for all the dt2 extras rows?
VB.NET:
dt1TableAdapter.Fill(Dataset.dt1)
cmd = New MySqlCommand("SELECT* from coupons", DataConnection.getRemoteConnection)
dr = cmd.ExecuteReader()
Dim dt2 As New DataTable
dt2.Load(dr)
Dataset.dt1.Merge(dt2)
dt1TableAdapter.Update(dt1)
Thanks