简体   繁体   中英

How do I get local database work on my client’s PC

I've built an application with a local.mdf database, and I've deployed the app. I tested it on my PC; there were no problems. The application works perfectly. Today, I installed the app on a client's PC, and I got this error:

在此处输入图像描述

Although all the files are in place and SQL Server 2016 installed on my client's PC.

I can think of two reasons:

  1. You either used a fixed source path like:
c:\MyProgram\database.mdf

So if you move the database somewhere else other than that folder, simply it won't work because it won't be able to find Database file.

Solution: use a dynamic location, so no matter where the app is installed, it should find your DB.

  1. the installed SQL Server is not the same version or higher as your DB, or not installed properly.

Solution: reinstall or repair SQL Server .

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