Click to See Complete Forum and Search --> : How to use disconnected recordset


jp140768
July 15th, 2005, 08:17 AM
Hi,

I am currently trying to make the transition from VB 6 to VB.Net. I went out and bought the SAMS Teach yourself book, and it was all going well until I got to the database and ADO.Net section.

In VB6, I would have always kept a connection to the database, so when the user updated a recordset, it went straight into the database, but according to the book I no longer do this.

I have read about creating the disconnected dataset, pulling in the missing schema etc, and how to put the changes back to the database.

As the recordset is disconnected, how do you guys handle multi user environments. For example say you have a database whose primary key is an identity (auto generated number), and you write a record to the database, what happens when I try to do the same. Both disconnected recordsets will get the same number won't they? Same kind of thing applies to the update and delete, say for example you had a call queue and users picking up calls at random from the queue - how do you reflect that a call is no longer available to all the other users?

Thanks for any help.

Shuja Ali
July 15th, 2005, 09:00 AM
Take a look at this link.. This will help you understand how ADO.NET handles Multi-User Database Transactions
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconoptimisticconcurrency.asp