简体   繁体   中英

C# and SQL Server database connection error in Destination computer?

I create an application in C# and I use a SQL Server database. The problem is when I make a setup file and install it on destination computer, it doesn't work and causes a connection error. I used bunch of connection strings and I still have a problem with this.

The last connection I used:

Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=D:\test.mdf;Integrated Security=True;Connect Timeout=30

But the problem with these connection is I should install SQL Server on destination computer, it doesn't work with compact version. Is there any way to connect database without installing full SQL Server on destination computer?

这不是通常的回答我自己的问题,但是由于朋友的要求我这样做,首先,我要感谢@marc_s,因为他解决了这个问题并告诉我解决方案,该解决方案是在目标计算机上安装SQLExpress,然后正确安装您可以在ConnectionString上附加数据库,然后开始使用您的应用程序,就这么简单。

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