Click here to Skip to main content
15,867,750 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I made a Desktop Application in C# using visual Studio 2010 and SQL Server Management Studio. When I deploy the project and run .exe file in Client's Computer it install perfectly but when I open the App and start using it give error message:


"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) "

What I have tried:

I again deploy the project and reinstall the setup
Posted
Updated 14-Dec-16 8:49am
Comments
$*Developer - Vaibhav*$ 14-Dec-16 8:48am    
Just refer below url :

http://stackoverflow.com/questions/18060667/why-am-i-getting-cannot-connect-to-server-a-network-related-or-instance-speci
Jochen Arndt 14-Dec-16 8:52am    
If your application requires a SQL server, you must use a connection string that is able to connect to the SQL server holding the data used by your application.

This can be a local one (which would require installing SQL server on the client) or providing a remote server that can be accessed from the client.
Richard MacCutchan 14-Dec-16 9:54am    
Check the path from the client PC to the database server, and make sure the connection string is correct.

 
Share this answer
 
Comments
Mahrukh Razi 19-Dec-16 3:24am    
What if I don't want to give remote access of my computer to client's computer.
How I can resolve the issue
go to Start and type "Service" & enable "SQL SERVER(MSSQLSEVER)" after enable then make it start
 
Share this answer
 
Comments
Dave Kreskowiak 14-Dec-16 15:29pm    
That's not going to be the problem. The major issue in these cases is a complete understanding of connection strings and having application dependencies on SQL Server.

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