undefined Private Sub txtAchatCode_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtAchatCode.TextChanged Try con = New OleDbConnection(cs) con.Open() cmd = New OleDbCommand("SELECT (ProductName) as [Nom de Produit],(Weight) as [Poids],(Price) as [Prix] from Product where Codebarre like '" & txtAchatCode.Text & "%' order by Codebarre", con) Dim myDA As OleDbDataAdapter = New OleDbDataAdapter(cmd) Dim myDataSet As DataSet = New DataSet() myDA.Fill(myDataSet, "Product") DataGridView1.DataSource = myDataSet.Tables("Product").DefaultView DataGridView2.DataSource = myDataSet.Tables("Product").DefaultView Panel2.Visible = True txtMTotal.Visible = True btnRegister.Visible = True btnPrint.Visible = True btnDelete.Visible = True Dim Total As Double For Each row As DataGridViewRow In DataGridView1.Rows Total = Total + row.Cells("Prix").Value Next txtTotal.Text = Total txtMTotal.Text = Total con.Close() Catch ex As Exception MessageBox.Show(ex.Message, "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
20 mars 2019 à 08:23