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 29 30
| Private Sub BtnActuPrix_Click(sender As Object, e As EventArgs) Handles BtnActuPrix.Click
Dim text1 As String = "UPDATE articles INNER Join tarif_buffer ON articles.item_code = tarif_buffer.item_code SET articles.item_description = tarif_buffer.item_des, articles.achat_price = tarif_buffer.achat_price, articles.price = tarif_buffer.vente_price, articles.date_modification = NOW() WHERE articles.item_code = tarif_buffer.item_code"
Dim text2 As String = "UPDATE tarif_general INNER Join tarif_buffer ON tarif_general.item_code = tarif_buffer.item_code SET tarif_general.item_description = tarif_buffer.item_des, tarif_general.dealer_price = tarif_buffer.achat_price, tarif_general.price = tarif_buffer.vente_price WHERE tarif_general.item_code = tarif_buffer.item_code"
Try
cn.Open()
Dim mySqlCommand1 As MySqlCommand = New MySqlCommand(text1, cn)
Dim mySqlCommand2 As MySqlCommand = New MySqlCommand(text2, cn)
Dim mySqlCommand3 As MySqlCommand = New MySqlCommand("TRUNCATE TABLE tarif_buffer", cn)
' mySqlCommand1.ExecuteNonQuery()
' MsgBox("Prix des articles mis à jour sufr articles", MsgBoxStyle.OkOnly, Nothing)
mySqlCommand2.ExecuteNonQuery()
MsgBox("Prix des articles mis à jour sur tarif général", MsgBoxStyle.OkOnly, Nothing)
' mySqlCommand3.ExecuteNonQuery()
cn.Close()
Catch ex As Exception
MsgBox("error" & ex.ToString)
End Try
cn.Close()
End Sub |
Partager