Sorry, I am a noob for C# programming. I have search for many times to load progressbar while restart the SQL Server Service, but there are a lot of code and it was messing me up. I don’t understand what was that mean. Can you all help me out, please ?
This is my code to restart the SQL Service.
I need code to load progressbar while restart the service.
private void btnRestart_Click(object sender, EventArgs e)
{
ServiceController sv;
sv = new ServiceController(“MSSQLSERVER”);
sv.Stop();
sv.Start();
sv.WaitForStatus(ServiceControllerStatus.Running);
}
user25463624 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.