简体   繁体   中英

Connecting to a local SQL Server database does not work in the setup exe application

After installing my setup exe application on "Client PC", all process are worked correctly, but when I try to save some data on the application's local SQL Server database, this exception is thrown and I do not know what the problem is, as this exception never happens on my own PC.

Is there any requirement must be installed on the client PC?

The exception is:

System.Data.SqlClient.SqlException (0x80131904)

例外

The connection string:

<connectionStrings>
    <add name="Appstore.Properties.Settings.StoringAppConnectionString"
         connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=StoringApp;Integrated Security=True"
         providerName="System.Data.SqlClient" />
</connectionStrings>

您使用OBDC连接或其他连接时,请确保与您的另一台PC上的连接相同。

Error 26 generally means that your SQL Server instance is not reachable. Typically it is attributed to the fact that SQL Server service not running. Can you verify that once. Also if its on a different computer, you many need to turn on TCP/IP protocol. Make sure to also put ports TCP-1433 and UDP-1434 in firewall exception. Let me know if this works out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM