I know that the state is changed to deleted, but what else happens ?, does
the table make a new version of itself each time or the row ?

The reason i'm asking is because I'm have a tough time understanding how
making changes to more than one row ( but not more than one change per row )
and then trying to update the dataadapter can cause a concurrency error.
There are no other users involved

any assistance is appreciated in understanding this . . .


Regards - Terry

Re: What happens when you delete a DataRow ? by Marina

Marina
Fri Aug 15 07:45:52 CDT 2003

A concurrency error just really means, that the adapter expect X rows to
successfully be updated/inserted/deleted - but that did not happen. This
typically happens because the conditions in the WHERE clause of the
generated queries are not met. It is assumed that this is a concurrency
issue (i.e. another user already changed this row, that's why the WHERE
conditions are not met).

Show us some code...

"Terry Burns" <terry_burns@BTOpenworld.com> wrote in message
news:O61ef8vYDHA.1940@TK2MSFTNGP10.phx.gbl...
> I know that the state is changed to deleted, but what else happens ?, does
> the table make a new version of itself each time or the row ?
>
> The reason i'm asking is because I'm have a tough time understanding how
> making changes to more than one row ( but not more than one change per
row )
> and then trying to update the dataadapter can cause a concurrency error.
> There are no other users involved
>
> any assistance is appreciated in understanding this . . .
>
>
> Regards - Terry
>
>



SORRY, this is the right code by One

One
Fri Aug 15 10:10:01 CDT 2003

try

'open connection

con.Open()

'Setup the Delete Command for events for this person

DeleteCmd.CommandText = "DELETE FROM Events " 'WHERE PersonIndex = ?"

DeleteCmd.Connection = con

DeleteCmd.CommandType = CommandType.Text

DeleteCmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("PersonIndex",
System.Data.OleDb.OleDbType.Integer, 0,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte),
"PersonIndex", System.Data.DataRowVersion.Original, Nothing))

daEvents.DeleteCommand = DeleteCmd

Dim r As DataRow

PersonIndex = CType(dgPeople.Item(dgPeople.CurrentRowIndex, 0), Int32)

Dim rc As Int32

Dim drc As DataRowCollection = tableEvents.Rows

For rc = drc.Count - 1 To 0 Step -1

drc(rc).Delete()

Next

daEvents.Update(tableEvents)

Catch ex As System.Data.DBConcurrencyException

MessageBox.Show(ex.Message)

Finally

If con.State = ConnectionState.Open Then

con.Close()

End If

DeletingRows = False

End Try

"Terry Burns" <terry_burns@BTOpenworld.com> wrote in message
news:O61ef8vYDHA.1940@TK2MSFTNGP10.phx.gbl...
> I know that the state is changed to deleted, but what else happens ?, does
> the table make a new version of itself each time or the row ?
>
> The reason i'm asking is because I'm have a tough time understanding how
> making changes to more than one row ( but not more than one change per
row )
> and then trying to update the dataadapter can cause a concurrency error.
> There are no other users involved
>
> any assistance is appreciated in understanding this . . .
>
>
> Regards - Terry
>
>