I wrote a C# Windows Form application that should communicate with SQL Server database. I have set Connection strings and the program works fine in my system, while other the program fails at connect to the database in other systems.
Since this application will be installed in customer's PC. How can I solve this issue?
The last way I tried was adding ConnectionString to the config file of the project:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="con"
connectionString="Data Source=2345pc037\SQLEXPRESS;Initial Catalog=prodDB;Integrated Security=true"
providerName="System.Data.SqlClient"/>
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
And here is the C# code:
SqlConnection cs = new SqlConnection();
strConn = string.Format({0}",ConfigurationManager.ConnectionStrings["con"].ConnectionString);
cs.ConnectionString = strConn;
Error message stated that either instance name is incorrect or SQL Server does not allow remote connections. Also: "error: 28 - The server does not support the requested protocol."