G
Guest
Dear reader
because of a large number of records in a database table I'm using paging. 1 record is being fetch everytime I requery the database (just the record the user requires). When I skip to the next record I check if the row has changes. If it does I generate this updatecommand
cmd = New OleDbCommand("UPDATE Customers SET Customers.[Name] = ?, Customers.[Lastname] = ? " &
"WHERE Customers.[CustID] = ?", mdbConnection
cmd.Parameters.Clear(
cmd.Parameters.Add("CustID", OleDbType.Char).Value = CType(dsCustomers.Tables(0).Rows(0).Item("CustID"),Integer)
cmd.Parameters.Add("Name", OleDbType.Char).Value = Me.txtTName.Tex
cmd.Parameters.Add("Lastname", OleDbType.Char).Value = Me.txtTLastname.Tex
daCustomer.UpdateCommand = cm
The problem is now that when I update, I get a concurrency violation (???). The strange thing is I'm the only one using this database and I don't get the concurrency violation when I'm using this parameter
cmd.Parameters.Add("CustID", OleDbType.Char).Value = 2
What could this be
Thx!
because of a large number of records in a database table I'm using paging. 1 record is being fetch everytime I requery the database (just the record the user requires). When I skip to the next record I check if the row has changes. If it does I generate this updatecommand
cmd = New OleDbCommand("UPDATE Customers SET Customers.[Name] = ?, Customers.[Lastname] = ? " &
"WHERE Customers.[CustID] = ?", mdbConnection
cmd.Parameters.Clear(
cmd.Parameters.Add("CustID", OleDbType.Char).Value = CType(dsCustomers.Tables(0).Rows(0).Item("CustID"),Integer)
cmd.Parameters.Add("Name", OleDbType.Char).Value = Me.txtTName.Tex
cmd.Parameters.Add("Lastname", OleDbType.Char).Value = Me.txtTLastname.Tex
daCustomer.UpdateCommand = cm
The problem is now that when I update, I get a concurrency violation (???). The strange thing is I'm the only one using this database and I don't get the concurrency violation when I'm using this parameter
cmd.Parameters.Add("CustID", OleDbType.Char).Value = 2
What could this be
Thx!