附加SQL Server Express DB并添加到VS2008中的安装项目 [英] Attaching SQL Server Express DB and adding to setup project in VS2008

查看:85
本文介绍了附加SQL Server Express DB并添加到VS2008中的安装项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


1)我通过Visual Studio添加了mdf文件.我正在尝试将其附加到SSMS,但它给出了错误.如何附上?我是否总是需要通过SSMS创建它们?

2)我通过SSMS创建了一个mdf,其物理路径是我应用程序的DataDirectory的路径.运行正常.现在,我需要对此应用程序进行设置.

a)我应该将此数据库添加到我的安装项目中吗?如果是,我的用户是否需要手动将其附加到SQL Server实例?我的连接字符串使用MyServer \ SQLExpress

b)我试图将这个数据库添加到安装项目中,但是它说您需要管理员权限.那是什么?如何设置?我已经在使用具有管理员权限的计算机.

请回答,因为我已经提出了明智的问题.
非常感谢.

Hi,
1) I added mdf file through Visual Studio. I am trying to attach it to SSMS but it gives error. How to attach it? Do I always need to create them through SSMS?

2) I created an mdf through SSMS and the physical path was of my DataDirectory of my application. It is running fine. Now I need to make Setup of this application.

a) Am I supposed to Add this database to my setup project? If yest, does my user need to attach it manually to the instance of SQL Server? My connection string uses MyServer\SQLExpress

b) I tried to add this database to setup project but it says you need administrator rights for this. What is that? How to set it up? I am already using computer with administrator rights.

Please reply as I have put up the questions point wise.
Thanks a lot.

推荐答案

检查本文
使用Installer类轻松部署SQL Server数据库 [ ^ ]
Check this article
Deploy SQL Server databases easily with an Installer class[^]


这篇关于附加SQL Server Express DB并添加到VS2008中的安装项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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