简体   繁体   中英

Install SQL Server Express edition in silent mode

I use C# and need to install SQL Server 2005 Express edition in silent mode in my project and use code below, but for the first time, SQL Server do not install correctly . Sql database engine do not install.. When I uninstall SQL Server 2005 Express edition from windows and install it from my project, it correctly installs.

What's wrong in my project ?

ProcessStartInfo psSqlServer = new ProcessStartInfo(Application.StartupPath + "\\SQLEXPR\\setup.exe ", "/qn ADDLOCAL=ALL INSTANCENAME=MSSQLSERVER SECURITYMODE=SQL SAPWD=123 SQLAUTOSTART=1 DISABLENETWORKPROTOCOLS=0");

Process pSqlServer = Process.Start(psSqlServer);
pSqlServer.WaitForExit();
Process pro = new Process();
pro.StartInfo.FileName = Application.StartupPath + "\SQLEXPR\setup.exe";
pro.StartInfo.Arguments = "/qs ADDLOCAL=ALL INSTANCENAME=MSSQLSERVER SECURITYMODE=SQL SAPWD=123 SQLAUTOSTART=1 DISABLENETWORKPROTOCOLS=0";

pro.StartInfo.CreateNoWindow = true;
pro.Start();
pro.WaitForExit();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM