1

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();
  • Check this stackoverflow posting and the links that are in some of the answers - http://stackoverflow.com/questions/11240463/install-sql-server-silently-from-application-setup-file – MethodMan Jan 21 '13 at 18:12
  • And what do you mean by "SQL Server did not install correctly"? – Jahan Zinedine Jan 21 '13 at 21:30

1 Answers1

0
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();