当我启动我的PC时,Sql Server(SQLExpress)没有运行,它在我尝试在Visual Studios 2010中编译我的程序时启动.
是否可以通过C#启动它?
我的问题是,如果我在没有Visual Studios的情况下使用.exe,它会告诉我Sql Server没有运行. 我会将Sql Server Windows服务的启动模式更改为自动. 但你也可以在c#中做到这一点,但我不推荐它.还有其他问题,如访问安全性等.System.Diagnostics.Process process = new System.Diagnostics.Process(); process.StartInfo.FileName = "net start \"Sql Server (SQLEXPRESS)\""; process.Start();
Sql Server(SQLEXPRESS)是您的服务名称.
查看更多关于通过C#启动SQL Server的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did69325