Click here to Skip to main content
15,946,320 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I have 2 pc connected in a LAN. One is having SQL server installed on it and a Win Application is running on its DB.

I like to connect second PC with the same SQL server to Fetch Data via LAN

What I have tried:

tried to make some configuration changes in the SQL server, but it resulted in the corruption of DB.
Posted
Comments
Richard MacCutchan 11-Jul-24 5:35am    
Please use the Improve question link above, and add complete details of what is not working. As it stands no one can giuess what your problem is.

1 solution

Provided the SQL installation is correct, and has been configured to allow network connections (the default), and has no ports blocked on the server firewall, all you need is a valid connection address (which will be of teh form \\MachineName\\InstanceName).

If you use SSMS to work out the connection, it can scan the local network and tell you which machines have which instances - to connect from your software, you would need to translate that into a valid connection string.

We can't help you do that: we have no access to your network or machines!

[edit]
if you are trying to produce an app that will connect to the same DB regardless of the PC it runs on, then this may help: Instance Storage - A Simple Way to Share Configuration Data among Applications[^] - I use it so that I can set it up once and not have to worry about it for any other app. If the server PC changes name or login type, I only have to change it once per machine / user (because the login permissions may be different between two machine users).
[/edit]
 
Share this answer
 
v2

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