如何使用C#静默安装SQL Server Express版 [英] how to install SQL Server Express edition using c# silently
问题描述
SECURITYMODE = SQL启用了混合模式身份验证,并且提供强大的SA密码很重要.
ADDLOCAL = ALL选择所有SQL Server Express组件进行安装.
DISABLENETWORKPROTOCOLS = 0以在实例中启用联网
qn用于静默安装
SECURITYMODE=SQL enables Mixed mode authentication and it is important to provide a strong SA password.
ADDLOCAL=ALL selects all the SQL Server Express components for installation.
DISABLENETWORKPROTOCOLS=0 to enable networking in the instance
qn is used to install silently
我发现上述这些参数在静默安装SQL Express 2005版时是必需的.
谁能指导我如何利用此代码并以静默方式安装SQL Server 2005 Express Edition.
I have found these above parameters which are required while silently install SQL Express 2005 edition.
Can anyone guide me how do i utilize this code and install SQL Server 2005 express edition silently.
推荐答案
private void button1_Click(object sender, EventArgs e)
{
Process p = new Process();
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = Application.StartupPath.Trim() + @"\SqlServer2005 Express\SQLEXPR.EXE";
//-q[n|b|r|f] Sets user interface (UI) level:
//n = no UI
//b = basic UI (progress only, no prompts)
//r = reduced UI (dialog at the end of installation)
//f = full UI
psi.Arguments = "/qb username=\"sa\" companyname=\"Rumtek\" addlocal=ALL disablenetworkprotocols=\"0\" instancename=\"SQLExpress\" SECURITYMODE=\"SQL\" SAPWD=\"lock\"";
p.StartInfo = psi;
p.Start();
}
在以下链接上获得安装SQL SERVER EXPRESS EDITION的好示例;
http://www.techrepublic.com/article/how-do-i-install-sql-server-2005-express-edition-and-sql-server-management-studio-express/6102265 [ http://msdn.microsoft.com/en-us/library/ms143722 (v = sql.90).aspx [ http://technet.microsoft.com/en-us/library/ms143441(SQL .90).aspx [ ^ ]
http://www.sqlserver-training.com/sql-server-2008-r2-express-edition-installation-with-screenshot/- [ http://www.youtube.com/watch?v=CXJP4D503Tk [ http://www.youtube.com/watch?v=oa7RSKQyAZc [
Hi,
Get a good example of installation SQL SERVER EXPRESS EDITION on following links;
http://www.techrepublic.com/article/how-do-i-install-sql-server-2005-express-edition-and-sql-server-management-studio-express/6102265[^]
http://msdn.microsoft.com/en-us/library/ms143722(v=sql.90).aspx[^]
http://technet.microsoft.com/en-us/library/ms143441(SQL.90).aspx[^]
http://www.sqlserver-training.com/sql-server-2008-r2-express-edition-installation-with-screenshot/-[^]
Here''s useful video on same;
http://www.youtube.com/watch?v=CXJP4D503Tk[^]
http://www.youtube.com/watch?v=oa7RSKQyAZc[^]
这篇关于如何使用C#静默安装SQL Server Express版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!