Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi,
 
I have created one application VS 2008 and SQL SERVER 2005 as backend. In database i have some primary key but they all are auto generated as I have true the Identity option of database in that. Now i would like to make it as multiuser. So for that what should i do? Does i need to change the database for multi user or not? Because i have used in built auto generate option does it require table or row level locking for mulit user environment or not? If it does not require table or row level locks then if i put the EXE of the application on different machines connected on LAN, is it require any change in database connection string? I have putted connection string in app.config file of my application.
 
Please help me if anyone has knowledge about this....
 
Thank you
Posted 8-Apr-11 21:20pm
Edited 8-Apr-11 22:37pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You may need to change the connection string, but probably not if they are all connected on the same LAN and in the same domain (MSHOME, or WORKGROUP tend to be the defaults). In any case, this should be in you app.config file, so that should not be a problem.
 
If you are using Identity fields as your Primary Key then the database will assign them and there should be no need to do any locking when entering new records. You may want to do row locking when you use UPDATE commands though, and consider using transactions if you are inserting or updating a group of records.
 
Otherwise, MsSQL should handle multi-user without you noticing, until you get to significant numbers of users, that is!
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Sql Server is a multi user database by nature. Unless you have deliberately put the database into single user mode other users can connect to it.
 
The connection string defines how to find the Sql Server from your machine. So most likely you have to change the connection string to include the new server name. For info about connection strings, see: http://www.connectionstrings.com/sql-server-2008[^]
 
Locking is a big area and the part you should take care of in the beginning is transactions. Locking is handled automatically for you. Have a look at this http://en.wikipedia.org/wiki/ACID_transactions[^]. That would give some basic info about transaction handling.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 310
1 OriginalGriff 285
2 Afzaal Ahmad Zeeshan 200
3 Sergey Alexandrovich Kryukov 195
4 BillWoodruff 180
0 OriginalGriff 6,499
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,193
3 Manas Bhardwaj 4,657
4 Maciej Los 4,120


Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 9 Apr 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100