i can't update my data at database
this my code :
VB.NET Code:
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click Try 'Dim ds As New DataSet Dim scmd As New OleDbCommand If bAdd Then scmd.CommandText = "insert into inv_t_products (prod_id,prod_name,unit,unitprice) " & _ "values(@prodid,@prodname,@unit,@unitprice)" Else 'modify scmd.CommandText = "update inv_t_products set prod_name=@prodname,unit=@unit,unitprice=@unitprice " & _ "where prod_id=@prodid" End If scmd.Parameters.Add(New OleDbParameter("@prodid", txtKd.Text)) scmd.Parameters.Add(New OleDbParameter("@prodname", txtNm.Text)) scmd.Parameters.Add(New OleDbParameter("@unit", txtSat.Text)) scmd.Parameters.Add(New OleDbParameter("@unitprice", txtHarga.Text)) scmd.Connection = dbConn scmd.ExecuteNonQuery() bUpdated = True Me.Close() Catch ex As Exception ERRDesc(ex) End Try MsgBox("Saved", MsgBoxStyle.Information) End Sub
i have problem when update data, data not updated.
how the solution ?
thank you




Reply With Quote