S
Sven Buggermann
Hi all,
Since my experience with sql is just beginning to grow
i use the commandbuilder object to generate updatecommands deletecommands
insertcommands.
With first run th update works without a problem
when i call my update function again (changing the same row again) i get
"Concurrency violation: the UpdateCommand affected 0 records."
Exception
The debugger shows that the dataset.datatable.row.rowstate = modified
But the update simply doesn't work
Does anyone know what i am doing wrong ?
any help would be greatly appreciated
Thanks & regards
Sven
Code:
For i = 0 to ds.tables.count -1
da.SelectCommand = New OleDb.OleDbCommand("SELECT * FROM " &
ds.Tables(i).TableName, mConnection)
comm = New OleDb.OleDbCommandBuilder(da)
da.UpdateCommand = comm.GetUpdateCommand
da.DeleteCommand = comm.GetDeleteCommand
da.InsertCommand = comm.GetInsertCommand
rowsaffected = da.Update(ds.Tables(i))
Debug.WriteLine("Updated table: " & ds.Tables(i).TableName & " affected
rows: " & rowsaffected)
Next
Since my experience with sql is just beginning to grow
i use the commandbuilder object to generate updatecommands deletecommands
insertcommands.
With first run th update works without a problem
when i call my update function again (changing the same row again) i get
"Concurrency violation: the UpdateCommand affected 0 records."
Exception
The debugger shows that the dataset.datatable.row.rowstate = modified
But the update simply doesn't work
Does anyone know what i am doing wrong ?
any help would be greatly appreciated
Thanks & regards
Sven
Code:
For i = 0 to ds.tables.count -1
da.SelectCommand = New OleDb.OleDbCommand("SELECT * FROM " &
ds.Tables(i).TableName, mConnection)
comm = New OleDb.OleDbCommandBuilder(da)
da.UpdateCommand = comm.GetUpdateCommand
da.DeleteCommand = comm.GetDeleteCommand
da.InsertCommand = comm.GetInsertCommand
rowsaffected = da.Update(ds.Tables(i))
Debug.WriteLine("Updated table: " & ds.Tables(i).TableName & " affected
rows: " & rowsaffected)
Next