简体   繁体   中英

Connection error c# sqlexpress

I have ac# project wit SQL express database. It works on my PC, but doesn't work in client PC and following error is 52&26.

How can I write a connection string to work on my PC and work on other PC's?

Use common Server for handling SQL Database. If your application is not developed for common Database Server system then you should replace your SQL instance name in the connection string with Client PC SQL instance name before deployment/creating setup file. Use App.config file for establishing connection with SQL. like below..

<add name="Yourconnectionname" connectionString="Database=YourDBname;Server=Change with Client Server Instane name;UID=clientid;PWD=clientpwd;" providerName="System.Data.SqlClient"/>

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