简体   繁体   中英

C# WPF app does not work on another PC using SQL Server CE local database

I'm new to C# and databases. I have a WPF project that must use a local database. I used SQL Server CE local database with a .sdf file in Visual Studio 2010. It works fine on my computer.

But when I'm trying to open my project on another PC, the app doesn't work.

I get this error:

在此处输入图片说明 >

My connection string is:

SqlCeConnection conn = new SqlCeConnection("Data Source=|DataDirectory|../../MyDB.sdf");

Thanks.

您需要下载3.5 SP2运行时MSI并将其安装在用户PC上: http : //www.microsoft.com/zh-cn/download/details.aspx?id=5783

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