'Can't access my SQL Server via C# form application from client device
I have a C# application that connect to an online server located on my machine when I test my application in visual studio it works fine but when I give the application to the client it doesn't work I am using this connecting string in my code directly in a click button event:
@"Data Source =MyServerIp\SQLEXPRESS; Initial Catalog = MyDBname; User Id = gues; Password=gues";
I have turned on mixed mode in my SQL server and I have done the configuration properly in my firewall and also in my router port forwarding still getting that error:
unhandled exception has occurred in your application. if you click Continue, the application will ignore the error and attempt to continue. If you click Quit, the application will close immediately. A network-related or instance-specific error occurred while establishing a connecting 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server).
I am sure of my IP and that it is accessible via the internet and also I am sure from my credential and my firewall settings
I have been told that the client must install a Local DB I have tried that, I installed Local DB I but didn't configure anything
Can you help me to find where is my problem exactly please?
UPDATE (problem solved) I probably had two problems at onc, which made it harder to debug. My two problems were:
Out dated net framework at client machines.
Wrong sql connection string, it got fixed by the answer below.
Excuse me I don't know how to change the state of question to Solved..
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
