C# code to start SQL Server (MySQLSERVER) Automatically
please help me I created a program via C# and connect to SQL Server on the desktop/laptop when I turn off the desktop/laptop and run again the SQL Server (MYSQLSERVER) not running automatically, I want C# code to run it automatically, I appreciate someone helps me to give me C# code.

Gowtham RamarRank #1,753 · 860 reputationPosted Oct 10, 2019, 10:28 PM EDT
For starting your services automatically, SQL Server needs an account with rights to start services during operating system start up.
To solve this issue you need to go Administrative Tools > Services > SQL Server(MSSQLSERVER or the name of your instances) > Right Click > Properties > Move to Log On > Set the Log On option using a Local System Account
If you have chosen this option, hit on Browse Button and find the Local Service Account or Network service Account there > Click in Apply.
Restart your computer and you will able to start your SQL Server.
Lava Noor54 reputationPosted Sep 24, 2020, 11:44 PM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Sep 25, 2020, 6:55 AM EDT
Laxmidhar SahooRank #383 · 6.6K reputationPosted Sep 25, 2020, 5:14 AM EDT