在安装项目中使用数据库不起作用 [英] use database in setup project not work

查看:85
本文介绍了在安装项目中使用数据库不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在解决方案中添加了一个安装项目.我的项目的数据库不是本地数据库(mdf文件),而是服务器文件(.\ sqlexpress).

I added a setup project to solution. my project has a database that is not a local database (a mdf file) and it is a server file (.\sqlexpress). how can I add this db to setup so my project can use it after installation in new pc?

推荐答案

您可以看到此链接
点击
单击
You can see this links
Click
Click


您是否要在运行数据库的计算机上安装数据库?安装程序?

在这种情况下,计算机将需要安装SQL Server实例来承载数据库.

您的安装程序如何处理此问题?您是否将SQL Server检测为安装的先决条件?

您基本上需要

*在安装机器上检测到SQL Server?
*如果未检测到,则引导SQL Express安装程序
*安装后,运行SQL脚本来安装数据库

之后,您的应用程序将能够连接到SQL实例并访问数据库
Do you want to install the database on the machine running the installer?

In which case, the machine would need an instance of SQL Server installed to host the database.

How is your installer handling this? Are you detecting SQL Server as a prerequisite to your install?

You basically need to

* Detect SQL Server on install machine?
* If not detected, bootstrap SQL Express Installer
* After install, run SQL script to install your database

After that, your application would be able to connect to the SQL instance and access your database


这篇关于在安装项目中使用数据库不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆