Hi All,

As a bit of background we have a local sql server database and a remote mysql server. I need to update all the changes made in the sql server database to the my sql database. I select all the sql server records as follows.

VB Code:
  1. Private Function getupcompdata() As Boolean
  2.  
  3.  
  4.         getupcompdata = True
  5.         Try
  6.  
  7.  
  8.             dsweb.Clear()
  9.  
  10.             sqlcon.Open()
  11.  
  12.             Dim spupcomp As New SqlClient.SqlCommand("spupcomp", sqlcon, Nothing)
  13.             spupcomp.CommandType = CommandType.StoredProcedure
  14.             Dim dasqlserver As New SqlDataAdapter
  15.             dasqlserver.SelectCommand = spupcomp
  16.             dasqlserver.Fill(dsweb, "company")
  17.             sqlcon.Close()
  18.             Me.DGWEB.DataSource = dsweb
  19.             Me.DGWEB.DataMember = "company"
  20.             If Me.BindingContext(dsweb, "company").Count() = 0 Then
  21.                 getupcompdata = False
  22.             End If
  23.  
  24.         Catch
  25.             getupcompdata = False
  26.         End Try
  27.     End Function
How can I update this to the mysql database, I really don't want to have to iterate through each record, generate an update comand run said update comand and then move on to the next record. Have tried toying around with the below, but suspect what I'm trying to do is impossible.

VB Code:
  1. Private Sub upsqlsql()
  2.         Try
  3.  
  4.             Dim dasql As MySqlDataAdapter = New MySqlDataAdapter
  5.             Dim cmd As MySqlCommand
  6.             Dim parm As MySqlParameter
  7.  
  8.             Dim spupcomp As New MySqlCommand("select * from company", MySqlConnection, Nothing)
  9.             dasql.SelectCommand = spupcomp
  10.  
  11.  
  12.             cmd = New MySqlCommand("UPDATE Company SET  CompanyName = @CompanyName " & _
  13.                                  "WHERE CompanyID = @oldCompanyID", MySqlConnection)
  14.  
  15.                         cmd.Parameters.Add("@CompanyName", SqlDbType.VarChar, 50, "CompanyName")
  16.  
  17.             parm = cmd.Parameters.Add("@oldCompanyID", SqlDbType.Int, 8, "CompanyID")
  18.             parm.SourceVersion = DataRowVersion.Original
  19.  
  20.             dasql.UpdateCommand = cmd
  21.             MySqlConnection.Open()
  22.  
  23.             dasql.Update(dsweb, "company")
  24.             MySqlConnection.Close()
  25.  
  26.         Catch ex As Exception
  27.             Me.TextBox1.Text = ex.ToString
  28.         End Try
  29.  
  30.  
  31.     End Sub

Basically any help or pointers would be great.