从命令行以编程方式安装sql server express时获得2067529716异常

时间:2017-01-10 12:39:15

标签: c# sql sql-server sql-server-2008 c#-4.0

我在64位计算机上安装sql server express但是我收到错误2067529716.我的安装没有成功完成。我的命令行精细代码是

 using (var configFile = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None))
            {
                StreamWriter writer = new StreamWriter(configFile);
                writer.WriteLine("[SQLSERVER2008]");
                writer.WriteLine("INSTANCEID=\"" + instanceName + "\"");
                writer.WriteLine("ACTION=\"Install\"");
                writer.WriteLine("FEATURES=SQLENGINE,REPLICATION");
                writer.WriteLine("HELP=\"False\"");
                writer.WriteLine("INDICATEPROGRESS=\"False\"");
                writer.WriteLine("QUIET=\"True\"");
                writer.WriteLine("QUIETSIMPLE=\"False\"");
                writer.WriteLine("X86=\"False\"");
                writer.WriteLine("ERRORREPORTING=\"False\"");
                writer.WriteLine("INSTALLSHAREDDIR=\"" + Application.StartupPath + "\"");
                writer.WriteLine("INSTALLSHAREDWOWDIR=\"" + Application.StartupPath + "\"");
                writer.WriteLine("INSTANCEDIR=\"" + Application.StartupPath + "\"");
                writer.WriteLine("SQMREPORTING=\"False\"");
                writer.WriteLine("INSTANCENAME=\"" + instanceName + "\"");
                writer.WriteLine("AGTSVCACCOUNT=\"Manual\"");
                writer.WriteLine("ISSVCSTARTUPTYPE=\"Automatic\"");
                writer.WriteLine("ISSVCACCOUNT=\"NT AUTHORITY\\NetworkService\"");
                writer.WriteLine("ASSVCSTARTUPTYPE=\"Automatic\"");
                writer.WriteLine("ASCOLLATION=\"Latin1_General_CI_AS\"");
                writer.WriteLine("ASDATADIR=\"Data\"");
                writer.WriteLine("ASLOGDIR=\"Log\"");
                writer.WriteLine("ASBACKUPDIR=\"Backup\"");
                writer.WriteLine("ASTEMPDIR=\"Temp\"");
                writer.WriteLine("ASCONFIGDIR=\"Config\"");
                writer.WriteLine("ASPROVIDERMSOLAP=\"1\"");
                writer.WriteLine("SQLSVCSTARTUPTYPE=\"Automatic\"");
                writer.WriteLine("FILESTREAMLEVEL=\"0\"");
                writer.WriteLine("ENABLERANU=\"True\"");
                writer.WriteLine("SQLCOLLATION=\"SQL_Latin1_General_CP1_CI_AS\"");
                writer.WriteLine("SQLSVCACCOUNT=\"NT AUTHORITY\\NETWORK SERVICE\"");
                writer.WriteLine("SQLSYSADMINACCOUNTS=\"" + Environment.MachineName + "\\" + Environment.UserName + "\"");
                writer.WriteLine("SECURITYMODE=\"SQL\"");
                writer.WriteLine("ADDCURRENTUSERASSQLADMIN=\"False\"");
                writer.WriteLine("TCPENABLED=\"0\"");
                writer.WriteLine("NPENABLED=\"0\"");
                writer.WriteLine("BROWSERSVCSTARTUPTYPE=\"Automatic\"");
                writer.WriteLine("RSSVCSTARTUPTYPE=\"Automatic\"");
                writer.WriteLine("RSINSTALLMODE=\"FilesOnlyMode\"");

                writer.Flush();
            }
        }

先谢谢,请帮我解决这个问题?

0 个答案:

没有答案