Click here to Skip to main content
15,914,074 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have installed mssql database on my laptop and i have created a c# application
that stores and retrieve data into the database. this is working normally, i try creating a peer to peer network and installed the c# application on the second computer and try accessing the sql database on the first laptop but was not able to access it. please can any one help me out with the configuration.

this is the connection string used
SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
            conn.ConnectionString = "Data Source=USER-PC;Initial Catalog=CENTRALDB;User ID=sa;Password=mike";
            conn.Open();
Posted
Comments
Abhinav S 30-Mar-15 14:19pm    
Do you get an error?
ZurdoDev 30-Mar-15 14:20pm    
Sql has to be running and you have to have a connection to it. What is the error? Otherwise we're just guessing at what the problem is.
PIEBALDconsult 30-Mar-15 14:21pm    
Probably due to port security on the "server". If so, you'll need to open the port.

1 solution

SQL Server must enable remote connections, see:
Configure the remote access Server Configuration Option[^]
tutorial: How to enable remote connections in SQL Server 2008?[^]

Sometimes it is necessary to change windows firewall settings: Configure the Windows Firewall to Allow SQL Server Access[^]
 
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