Hello
I did a code that will update a record in some table from vb.net
Everything went nicely with no error to show me the msg "Done"
But after I open my database I found my database the row doesnt changed
who can figure it out for me ?
I did a code that will update a record in some table from vb.net
VB.NET:
Try conn.Open()
Dim cmdUpdate As New OleDbCommand
cmdUpdate.Connection = conn
cmdUpdate.CommandText = "UPDATE nurses SET num_n='@a1', name_n='@a2' , id_n='@a3' , birth_n='@a4', sex_n='@a5', nationality_n='@a6', salary_n='@a7', note_n='@a8' WHERE num_n='@a1' "
cmdUpdate.Parameters.AddWithValue("@a1", TxtNum.Text)
cmdUpdate.Parameters.AddWithValue("@a2", txtName.Text)
cmdUpdate.Parameters.AddWithValue("@a3", txtId.Text)
cmdUpdate.Parameters.AddWithValue("@a4", datep.Value.Date)
cmdUpdate.Parameters.AddWithValue("@a5", radioSex.Checked)
cmdUpdate.Parameters.AddWithValue("@a6", 1)
cmdUpdate.Parameters.AddWithValue("@a7", txtSalary.Text)
cmdUpdate.Parameters.AddWithValue("@a8", txtNotes.Text)
cmdUpdate.ExecuteNonQuery()
MsgBox("Done")
Catch ex As Exception
MsgBox( ex.Message)
End Try
conn.Close()
Everything went nicely with no error to show me the msg "Done"
But after I open my database I found my database the row doesnt changed
who can figure it out for me ?