I have 2 servers that contain the same databases with the same structure (Main Server + Sub Server).
- I deleted all data from the table in the sub server.
- I got the data from the table from the main server and put it in Datatable.
- I copied the data from the Datatable of the server2.
- I use Dataadapter2 to update the table in the sub server.
but still, the sub server is empty?!
'Delete Data From The Sub Server
xSlConn.Open()
Dim xcmddelete As New MySqlCommand("Delete FROM tblplaces", xSlConn)
xcmddelete.ExecuteNonQuery()
'Get Data Drom The Main Server
Conn.Open()
Dim xcmd1 As New MySqlCommand("SELECT * FROM tblplaces", Conn)
Dim xdt1 As New DataTable
Dim xda1 As New MySqlDataAdapter(xcmd1)
xda1.Fill(xdt1)
'Preparing the datatable for the Sub Server
Dim xcmd As New MySqlCommand("SELECT * FROM tblplaces", xSlConn)
Dim xdt2 As New DataTable
Dim xda2 As New MySqlCommand(xcmd)
Dim xB As New MySqlCommandBuilder(xda2)
xda2.Fill(xdt2)
'Copt the data from the main datatable to the sub datatable
xdt2 = xdt1.Copy()
'Update The Datatable2
xB.GetUpdateCommand()
xda2.Update(xdt2)