dfk
New member
- Joined
- Oct 9, 2006
- Messages
- 2
- Programming Experience
- Beginner
hi, i'm a newbie trying to update a single record in vb using access database. an oleDbException was unhandled error occured at the 'dbCommand.ExecuteNonQuery()' line.
it says no value is give for one or more parameters. although i did not leave the textbox fields empty during runtime. is it possible to update a record with empty values or original value?
thanks..
it says no value is give for one or more parameters. although i did not leave the textbox fields empty during runtime. is it possible to update a record with empty values or original value?
thanks..
VB.NET:
dbCommand.Connection = con
dbCommand.Connection.Open()
dbCommand.CommandText = "UPDATE Table SET T_name = @nm, T_telno = @tel WHERE T_index = @id"
dbCommand.Parameters.AddWithValue("@nm", nameTextBox.Text)
dbCommand.Parameters.AddWithValue("@tel", telTextBox.Text)
dbCommand.ExecuteNonQuery()
dbCommand.Connection.Close()