0

I built an application in C# for printing reports (management system) which is running fine in my system. When I transferred it to my clients computer it gives error on printing invoice. I am using report viewer. The program is running fine i-e data insertion,deletion etc in clients computer.

ERROR:

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 instance name is correct and that SQL server is configured to allow remote connections(provider named pipes provider error 40- could not open a connection to SQL server)

I have tried

  • Named pipes/TCP is enabled
  • Remote connections are allowed
  • Windows Firewall is off
  • Created an exception for port 1433 in Windows Firewall
  • Enabled everything in SQL Server Configuration Manager
gotqn
  • 42,737
  • 46
  • 157
  • 243
  • http://stackoverflow.com/questions/18060667/connect-to-server-a-network-related-or-instance-specific-error (duplicate) – shujaat siddiqui Sep 01 '14 at 06:32
  • Have you tried logging/debugging to ensure that other errors haven't occured forcing this error to be shown? Your question is a little too broad for stackoverflow to provide a definite answer. – Sayse Sep 01 '14 at 06:34

1 Answers1

0

If you have enabled Tcp connection and tested all firewall setting for your sql sever then it could be problem with your connection string.Can you past the connection method what you are using on client machine..

You have to give ip address of server in data source with port number 1433.

like this:
Data Source=XXX.XXX.XXX.XXX,1433;Network Library=DBMSSOCN;Initial Catalog=dbName;User ID=yourUID;Password=pass;
yogi970
  • 446
  • 5
  • 14