I have created a windows service & my service is dependent on the SQL server service. First, SQL started and then my service started when starting PC or restarting PC.>
you can add this on Connection string
persist security info=True