Retrieving a value from the database

  • Thread starter Thread starter Tom Archer
  • Start date Start date
T

Tom Archer

When handling a concurrency conflict, is there a way to
get the value currently in the database without having to
manually create a command object?

Someone here pointed to the MS site where they have
a "walkthrough" on handling concurrency issues. However,
their demo uses two datasets in one app with the code
simultaneously accessing both! Unfortunately, this doesn't
represent a realistic scenario where the client is running
on multiple machines (and not in the same app).
 
I've been trying exactly the same thing, and the answer appears to be NO (a
step backwards relative to ADO 2.x). The Wrox Press book on Programming
ADO.Net appears to confirm this.

Even if you set the SqlCommand.UpdatedRowSource to update the row following
the operation, it appears that the database is queried but the data
discarded because of the conflict which occurred on that row. It seems to
me that it would have been fairly simple to use that information to provide
an additional row version (e.g. UnderlyingValue) as per ADO2.x, but no such
row version exists.

NB the DataRow.GetColumnsInError method also doesn't appear to work,
probably because of the same thing - i.e that ADO.Net doesn't look at the
current data in the database to identify which columns are in error.

Regards,

Neil McKechnie
 
Back
Top