Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
2.20/5 (3 votes)
See more:
hi We have Sql Server 2008 on our Server.I can remote access to server(with Username and Password) and start or stop the Sql Server.
Now i want to start and stop the Sql Server which is on server,without remote access.
This is my Code:

C#
ServiceController sc=new ServiceController("MSSQLSERER","mc040"); 
sc.Start();


"mc040" is my computer name;
This code is working well,but it does not work for my server.
what should i do?
Posted
Comments
Herman<T>.Instance 21-May-14 3:01am    
You miss a 'V'in MsSqlSerVer
Sergey Alexandrovich Kryukov 21-May-14 11:08am    
...And it does not matter if you are using RDP or not.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900