Multiple VB2008 field updates

  • How do you account for multiple VB clients performing an update on a field with an autonumber (identity field), since the VB data adapter downloads a copy of the table to the local machine, and then performs an update. This could result in two clients updating the same autonumber.

  • At least in my DataAccess, which is based on MS application blocks, in .NET, the adapter uses negative numbers for new rows...-1,-2, etc. for any of the typed data sets.

    when it posts to the server, it updates the new rows with the actual value returned by the server. then, IF my typed dataset had child tables for the new rows that got added in the parent, they get updated to the new FK values, and then THEY post to the server, so the child tables, that had negative PK placeholders, get the new values from the server.

    so there's no concurrency issues, because .NET is not assuming it is going to use the next identity().

    Does that help?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thanks for the info. Wasn't sure if this would be an issue.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply