1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
'effectuer l'update dans de adresse dans bd mysql
sql = "select * from Address where flagUpdate = 1 and CompanyId = " & IdCpny & ""
cmd = New OleDbCommand(sql)
dta = New OleDbDataAdapter(cmd)
cmd.Connection() = cnx
'chargement du DataSet à partir du DataAdapter
dta.Fill(dts, "Address")
'chargement de la DataTable à partir du DataSet
dtt = dts.Tables("Address")
If dtt.Rows.Count <> 0 Then
sql = "UPDATE Address SET Address = '" & dtt.Rows(0).Item("Address") & "', City = '" & dtt.Rows(0).Item("City") & "', State = '" & dtt.Rows(0).Item("State") & "', Zip = '" & dtt.Rows(0).Item("Zip") & "', Country = '" & dtt.Rows(0).Item("Country") & "', Phone = '" & dtt.Rows(0).Item("Phone") & "', Fax = '" & dtt.Rows(0).Item("Fax") & "', Email = '" & dtt.Rows(0).Item("Email") & "' WHERE CompanyId = " & IdCpny & " "
cmd1 = New OdbcCommand(sql)
MsgBox(sql)
dta1 = New OdbcDataAdapter(cmd1)
cmd1.Connection() = cnx1
'chargement du DataSet à partir du DataAdapter
dta1.Fill(dts1, "Address")
'chargement de la DataTable à partir du DataSet
dtt1 = dts1.Tables("Address") |
Partager