如何在安装包中包含SQL Express并更改一些选项? [英] How to include SQL Express in Installation Package and change some option?

查看:62
本文介绍了如何在安装包中包含SQL Express并更改一些选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那里,



我正在开发一个使用SQL Express作为
数据库的Web应用程序项目。 />
我发现我可以在安装

项目中包含SQL Server 2005 Express Edition作为先决条件,

这很酷。

但我需要做更多的事情,我想将身份验证模式改为

Windows身份验证模式

(默认值)为SQL Server验证模式并为用户sa分配默认

密码,并且

我想附加一个将包含在安装中的数据库文件

光盘。



需要帮助。谢谢。



祝福!

Hi, there,

I''m working on a web application project which uses SQL Express as
database.
I found I can include SQL Server 2005 Express Edition in the installation
project as Prerequisite,
that''s cool.
But I need do more things, I want to change the "Authentication Mode" from
"Windows Authentication mode"
(which is default) to "SQL Server Authentication mode" and assign a "default
password" to user "sa", and
I want to attach a database file which will be include on the installation
disc.

Help needed. Thank you.

Best wishes!

推荐答案

由于您已将SQL作为先决条件,如果SQL不可用,安装程序将首先安装SQL。在SQL安装期间,您可以更改SQL Server设置。

在安装和部署项目中,您可以编写自定义操作,您可以在其中定义需要执行的操作。

一旦SQL Server已安装并且安装了app二进制文件,您可以调用这些自定义操作并使用SQL SMO API附加数据库文件。

阅读本文http://msdn.microsoft.com/en-us/library/ms165716(SQL.90).aspx [ ^ ]。 mdf文件到SQL Express。



以下链接也可以帮到你。

将mdf文件附加到C#安装项目 [ ^ ]
Since you have included SQL as a pre-requisite, if SQL is not available the setup will first install SQL. During SQL Installation you can change SQL Server settings.
In Setup and Deploy project you can write Custom Actions where you can define what needs to be done.
Once the SQL Server is installed and you app binaries are installed you can invoke these custom action and attach the database file using SQL SMO APIs.
Go through this article http://msdn.microsoft.com/en-us/library/ms165716(SQL.90).aspx[^] on how to attach a .mdf file to SQL Express.

The following links may also help you.
Attaching an mdf file to a C# setup project[^]


我想你不能从setup中做到这一点。您必须手动执行或在批处理文件中使用OSql。
I guess you cannot do this from setup. You have to do it manually or use OSql in batch files.


这篇关于如何在安装包中包含SQL Express并更改一些选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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