tags:

views:

18

answers:

1

I have created a Dataview on my datatable

 Dim _viewbyJob As New DataView(objts)

I use this to get a certain row out of the datatable. When I wan to update the datatable like so..

objta.Update(objts)

I get a concuurency exception.

Concurrency violation: the UpdateCommand affected 0 of the expected 1 records.

I can see that the datatable objts has the changes in it, but it wont update.

Do I have to do something with the dataview _viewbyJob in order for this to work? Do I maybe have to do this?

objta.Update(viewbyJob) 'that does not seem to make sense to me.
A: 

If you are updating from the view you have to call the AcceptChanges() method on the datatable associated with the view in order to update it.

Nick LaMarca