Problem accessing the SQL server Database from different computers at the same time

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Problem accessing the SQL server Database from different computers at the same time

Hello guys i have a problem that i really need to solve, I have finished my application using VS2012 and SQL Server DB, before i create an exe to install in different computers i would like to know " HOW MULTIPLE USERS CAN CONNECT AT THE SAME TIME FROM THEIR COMPUTERS TO THE SERVER ". I have installed a server with an IP adress and there is my connectionstring: Conn=new Sqlconnection("Data source=192.168.1.5;Database=GDBM;Uid=sa;Pwd=Admin58744d")

How can different users login with their sessions in order to add data for example??? of perform any other action????

Re: Problem accessing the SQL server Database from different computers at the same ti

Your question doesn't really make sense. You write code in your application to connect to the database. That's it. If multiple users are running your app at the same time then multiple users will inherently be connecting to the database. You don't have to do anything extra.

I suspect that you actually want an answer to a question that you're not asking. Please try to articulate what you want clearly. Are you perhaps trying to ask how the database can identify each user when they save data? If so then you would need to send some information about the user, e.g. you could send the IP address of the client if you care about location or you could add user management to your system and require them to login if you care about the actual person. You could also get the logged-in Windows user name and send that. You may even be able to connect using integrated security and get the user name on the server side, but I've never tried that so I don't know if it's possible.

Re: Problem accessing the SQL server Database from different computers at the same ti

Look into optimistic concurrency, which is built into ADO.NET. Basically, you retrieve data, edit it and then try to save and the system tells you if someone else modified that same data in the meantime. If they did then it's up you as the developer how to proceed. Usually, you would retrieve the current data and merge that with your user's modified data, get them to confirm the result and then try to save again.

Re: Problem accessing the SQL server Database from different computers at the same ti

If you are seeking confirmation that this won't be an issue, you can have it. JMC talked about a specific case, but lots of times, optimistic concurrency takes no real effort. The only issue arises if two users attempt to edit the same record at the same time. If it is just a matter of multiple users entering NEW data at the same time, there is nothing you need to do. That's just how it works, so if you are really seeking assurance that this will be okay....it will.