PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Unexpected update to Access DB when using a Strongly Typed Dataset

Reply

Unexpected update to Access DB when using a Strongly Typed Dataset

 
Thread Tools Rate Thread
Old 21-06-2006, 06:31 AM   #1
=?Utf-8?B?SmltIFBhcnNlbGxz?=
Guest
 
Posts: n/a
Default Unexpected update to Access DB when using a Strongly Typed Dataset


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
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off