Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I've programmed an inventory system in C# using sql server database, how can I use from more than a computer in the same time through a local network?
Posted
Comments
ChrisCreateBoss 16-Oct-15 20:30pm    
Maybe using System.Net.Sockets? With a TcpServer/Client? There are so many ways to do it. What have you tried?

1 solution

Hi, Setup your inventory database in a separate system(server), and configure the database to allow remote connections. Now you have to modify your connection string, connection string needs to be pointed the database in the server.
C#
Data Source=127.2.3.4\SQLEXPRESS,1433;Network Library=DBMSSOCN;Initial Catalog=database_name_here;User ID=user_id_here;Password=password_here

Data Source=127.2.3.4\SQLEXPRESS,1433;, in this line,
127.2.3.4 - denotes the server IP address.
SQLEXPRESS - denotes the database server instance.
1433 - denotes the server port number.
After setup of the database server, you can use your application in any PC inside the LAN, and it will connects the database in the server as per the connection string.
 
Share this answer
 
Comments
Ma3d Sa3eed 17-Oct-15 3:21am    
Hello, brother.
thanks for your help, but I have a simple question, please.
where should I put my database file? in which path in server?
I don't know anything in networks?
VR Karthikeyan 17-Oct-15 4:22am    
Which database you are using?
Ma3d Sa3eed 17-Oct-15 14:20pm    
sql sever database
VR Karthikeyan 18-Oct-15 11:15am    
install SQL Server in server and put your files in the following folder of SQL Server - C:\Program Files\Microsoft SQL Server\MSSQL.90\MSSQL\Data\
VR Karthikeyan 18-Oct-15 11:27am    
After adding your files to the SQL Server database, you need to attach the .mdb files to your SQL Server Instance running on your Server. For that, follow the instructions on the following link - Attach .mdb files to SQL Server Instance. And you need to enable remote access to the SQL Server, for that refer this link - SQL Server Configuration to Allow Remote Access. After this setup, you can able to connect your database from your application which installed on different PC in same LAN by using the connection string specified in the solution.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900