title: synchronizing two mysql databases in vb.net
body: <p>I am trying to sync two mysql databases.
  I have managed to sync a table with this method:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Dim oldbcon As New MySqlConnection("server=localhost;database=psugsonline;userid=root;password=;")
  Dim dbconn As New MySqlConnection("server=localhost;database=psugs;userid=root;password=;")
  
  Dim da As New MySqlDataAdapter("select * from tbusers where sync='false'", dbconn)
  Dim ds As New DataSet
  ds.Clear()
  da.Fill(ds)
  If ds.Tables(0).Rows.Count &gt; 0 Then
      Dim x As Integer
      For x = 0 To ds.Tables(0).Rows.Count - 1
  
          Dim instbuser As New MySqlCommand("insert into tbusers values('" &amp; ds.Tables(0).Rows(x)(0).ToString &amp; "','" &amp; ds.Tables(0).Rows(x)(1).ToString &amp; "','" &amp; ds.Tables(0).Rows(x)(2).ToString &amp; "','" &amp; ds.Tables(0).Rows(x)(3).ToString &amp; "','true')", oldbcon)
          oldbcon.Open()
          instbuser.ExecuteNonQuery()
          oldbcon.Close()
      Next
  End If
  </code></pre>
  
  <p>But this method only applies to one of my tables and if the table structure changes this method would not work.</p>
  
  <p>I've to sync 16 tables.How can i achieve this?</p>