Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 30th, 2005, 01:07 AM
Registered User
 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to SolverSurfer
Default VB .Net MultiUser Environmnet?

Hi,

  I am just getting into to Programming VB .NET. One thing that come into mind is that is VB .Net is intended for a multi-user environment? The reason I ask this question is that since that is being querried from the database are being manipulated in memory; therefore, when another user access that same information and make changes to those data then it would not reflect the change that is currently present in the other user memory. This is because of how dataset and dataview are designed.

Am I right or am I wrong?

Nicolas
 
Old June 30th, 2005, 05:39 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

This situation is known as data concurrency. If you expect that your users will be looking at/changing the same data you have to take this into account and write your application accordingly. If you use the .NET "wizards" to add data IO controls such as data adapters to your forms, it can construct update queries that use what is known as "pessimistic concurrency checks" on the updates. I'll explain in a simple example. Let's say we have a table "Users" with this structure:

Code:
UserID FirstName
====== =========
12     Nicolas
The key field on this table is UserID. Normally when you update this record, you use a query like this:

UPDATE Users SET FirstName='Peter' WHERE UserID=12

This is an optimistic update. You update it hoping that no one else has changed the FirstName field since you looked at it. The pessimistic update for this same record would look like this:

UPDATE Users SET FirstName='Peter' WHERE UserID=12 AND FirstName='Nicolas'

This query will only update the data if it hasn't changed since you looked at it. The ADO.NET DataTable keeps track of changes to rows and you can construct queries that have parameters tied to original values on changed rows. This allows for pessimistic updates that tell you if you can't update the row because of changed data.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiuser Access application. rupen Access VBA 2 August 10th, 2007 06:46 AM
Grid View in Multiuser Environment contactajo ASP.NET 2.0 Professional 0 June 6th, 2006 10:32 AM
VB.Net question on Windows VB.Net datagrids dmsousa VS.NET 2002/2003 1 January 19th, 2005 02:45 PM
Multiuser access 97 runtime error anonymous1 Access 0 December 24th, 2004 09:48 AM
Multiuser Considerations In SQL devrishi SQL Server 2000 15 August 12th, 2004 09:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.