C
Chris Thunell
I am trying to delete all the records in a table, but I keep getting a
system.data.dbconcurrency exception. Is there an easy was to delete all the
records in a sql table?
Here is my code... i get the error on the dataadapter.update:
MessageBox.Show(Me.DataSet11.tblPreReqWorking.Rows.Count)
'get rid of any records in memory
Me.DataSet11.tblPreReqWorking.Clear()
Me.daPreReqWorking.SelectCommand.CommandText = "Select JobNo, ReqNo, SeqNo
From dbo.tblPreReqWorking"
Me.daPreReqWorking.Fill(Me.DataSet11.tblPreReqWorking)
MessageBox.Show(Me.DataSet11.tblPreReqWorking.Rows.Count)
Dim myRow As DataRow
For Each myRow In Me.DataSet11.tblPreReqWorking
myRow.Delete()
Next
'this is where i get the dbconcurrency error
Me.daPreReqWorking.Update(Me.DataSet11.tblPreReqWorking)
'i don't get this far
Me.DataSet11.tblPreReqWorking.Clear()
system.data.dbconcurrency exception. Is there an easy was to delete all the
records in a sql table?
Here is my code... i get the error on the dataadapter.update:
MessageBox.Show(Me.DataSet11.tblPreReqWorking.Rows.Count)
'get rid of any records in memory
Me.DataSet11.tblPreReqWorking.Clear()
Me.daPreReqWorking.SelectCommand.CommandText = "Select JobNo, ReqNo, SeqNo
From dbo.tblPreReqWorking"
Me.daPreReqWorking.Fill(Me.DataSet11.tblPreReqWorking)
MessageBox.Show(Me.DataSet11.tblPreReqWorking.Rows.Count)
Dim myRow As DataRow
For Each myRow In Me.DataSet11.tblPreReqWorking
myRow.Delete()
Next
'this is where i get the dbconcurrency error
Me.daPreReqWorking.Update(Me.DataSet11.tblPreReqWorking)
'i don't get this far
Me.DataSet11.tblPreReqWorking.Clear()