PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Unexpected update to Access DB when using a Strongly Typed Dataset
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Unexpected update to Access DB when using a Strongly Typed Dataset
![]() |
Unexpected update to Access DB when using a Strongly Typed Dataset |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I am working with a Strongly Typed Dataset which I Fill from an Access2000
DB. I am using VS2005 and VB.Net. Perhaps I am missing something, but the observed problem is: Given a sub-set of Rows from a Table in that Dataset, code in the following form behaves unexpectedly: For Each DR as DefaultDataSet.BasicInfoRow in subset DR.Field1 = NewValue Next The unexpected result is that with a breakpoint set on the Next statement, I can observe the Field1 values changing IN THE ACCESS DB. Note the absence of any explicit Update statement. In fact I discovered this when my subsequent Update threw an: DBConcurrencyException: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records Interestingly enough, the For loop was changing 10 - 20 Rows, all of which are properly updated in the Access DB and they were updated at the time the DataTable Row was updated. For other reasons, I do have a Handler for the BasicInfoRowChanged event, which is raised for each change. I do not do an Update in that Handler. Nor do I see an Update in the generated DefaultDataSet.Designer code which I step thru. My understanding is that making a change to the DataTable is a DataTable-only operation and should have no effect on the original DB. I expected that changes to the DB would ONLY occur when explicitly requested via a DataAdapter.Update(...) statement. What am I missing here? I have not tried this outside of the VS2005 environment (ie a Release version run standalone). -- Jim Parsells |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

