Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I want to connect sql express database using c# application in LAN.
I have sql Express installed on one machine,i want to connect it from other machine in LAN.
How should i do this?
plz help
Posted

Basically, you connect to a database by using Connection Strings[^]. This will, of course depend on what database server do you want to connect to. Check here[^] for the different connection strings. You also need to familiarize yourself with ADO.Net[^] in order to connect to the database, using the connection string. Most of the classes that you will need are in System.Data.SqlClient[^] namespace so make sure you check on it as well.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-May-12 1:49am    
In a nutshell....
My 5.
--SA
walterhevedeich 9-May-12 1:51am    
Thanks SA.
Hi,

You can use SQL Express on LAN(on different machine) in the same way as on local machine. Just give IP address of the machine where SQL express is installed and SQL instance name in the connection string like below:
<br />
Data Source=192.168.0.52\SQLExpress; User ID=sa; Password=YourPassword; Initial Catalog=YourDatabase;


You also need to configure SQL Server to allow remote connection
http://support.microsoft.com/kb/914277[^]
 
Share this answer
 
v2
astika..First..Configure Your Surface Area Configuration.To Mode That Allow Both Tcp/IP..Then.Open Your SSMS..connect using the system name..Using Server Configuration.
 
Share this answer
 

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