Click here to Skip to main content
15,904,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have .net disktop application with SQLServer 2005 Database .

i make attach to the DataBase via the application by c# code via VisualStodio ide ,

to make that i have to refresh SQLBrowser service and start it if it's disable

it works correctly on windows 32bit BUT on windows 64bit it gives me that error

{"Cannot open SQLBrowser service on computer '.'."}

{"Access is denied"}



how can i access any service on windows 64bit via my C#code??????????
Posted

1 solution

I'm assuming by open you mean start the browser service. Your application needs elevated permission to start the service. Try running it as administrator and see if you can start the service that way. I wouldn't recommend running the entire app as administrator all the time but the portion for managing services probably needs that elevation.
 
Share this answer
 
v2

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