Click here to Skip to main content
15,893,904 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have this connection string

connectionString = "Data Source=.;Integrated Security=SSPI;Initial Catalog=sms;Persist Security Info=False;Connect Timeout=60";

And, its running perfectly on my system.

But, when i run the software with this connection string on my client's system. I am getting an error as "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

In my client's system sql server 2008 has an instance name "SQLEXPRESS" and changed the connection string to

connectionString = "Data Source=.\\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=sms;Persist Security Info=False;Connect Timeout=60";

but the result was the same error.

Please tell how can i resolve this problem.
Posted
Comments

1 solution

"Data Source = " should point to the server which is running the SQL server. "." means connect to my local machine and you probably don't have SQL installed there [the clients system].

Change it to the IP address of the SQL Server i.e. "Data Source = 192.168.1.1\\SQLEXPRESS" etc.
 
Share this answer
 
Comments
sam9918 27-Oct-13 5:52am    
I tried with ip address also but still the same error. SQL Server 2008 is installed on my client's machine.
Mehdi Gholam 27-Oct-13 5:58am    
Make sure you have configured the firewall on your server and that networking is enabled on SQL server see here : http://technet.microsoft.com/en-us/library/hh231672.aspx

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