为的WinForms与本地数据库创建安装数据库、WinForms

2023-09-03 17:06:47 作者:老衲丶只沾花不惹草

我有一个WinForms应用程序(跳棋游戏),其中有一个本地数据库(使用SQL Server防爆preSS) 保存注册的球员和他们的分数。

I have a Winforms application (checkers game) which have a local DB (using SQL Server Express) to save the registered players and their scores..

我想创建一个安装这个应用程序通过这个教程

I'm trying to create an installer for this app by this tutorial

一切都很好,但是当我尝试添加的球员,我得到一个SQL错误 ,说找不到数据库..所以我怎么可以添加本地数据库( .MDF 文件)到安装程序?

Everything is fine, but when I'm trying to add the players I'm getting a SQL error that says the database wasn't found.. so how can I add the local DB (.mdf file) to the installer?

推荐答案

只要条件使用本地数据库在客户端机器都OK了(见的的LocalDB部署到客户端PC ),在部署项目你可以将数据库文件添加到应用程序文件夹(选择在Solution Explorer文件系统编辑器部署项目时,被选中。

Provided that the conditions to use local DB at the client machine are OK (see LocalDB deployment on client PC), in the deployment project you can just add the database files to the application folder (Choose File System Editor in the solution explorer when the deployment project is selected.

旁注:你知道的事实是,在VS2012微星部署项目模板是pcated德$ P $

Side note: Are you aware of the fact that in VS2012 the MSI deployment project template is deprecated?

增加:和它的回在 VS 2013!

 
精彩推荐
图片推荐