Question Update with Value of DataGridViewCheckBoxColumn

ncastillo

Member
Joined
Nov 12, 2013
Messages
11
Programming Experience
1-3
I'm trying to update an MS Access database with the value of a DataGridViewCheckBoxColumn using an OleDBDataAdapter and I keep getting a 'Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.' Please see my update parameters below. I would appreciate your assistance. Thanks!

Dim UpdateString As String = <s> UPDATE tblAccount
SET Username = @Username, FirstName = @FirstName, LastName = @LastName,
Pwd = @Pwd, Grp = @Grp, chkAccount = @chkAccount WHERE AnalystID = @AnalystID </s>

Dim UpdateCommand As New OleDbCommand(UpdateString, conn)

With UpdateCommand.Parameters
.Add("@Username", OleDbType.VarChar, 10, "Username")
.Add("@FirstName", OleDbType.VarChar, 25, "FirstName")
.Add("@LastName", OleDbType.VarChar, 25, "LastName")
.Add("@Pwd", OleDbType.VarChar, 10, "Pwd")
.Add("@Grp", OleDbType.VarChar, 10, "Grp")
.Add("@AnalystID", OleDbType.Integer, 4, "AnalystID")
.Add("@chkAccount", OleDbType.Boolean, 0, "chkAccount")
End With
 
Back
Top