Results 1 to 5 of 5

Thread: Stopping SQLExpress service

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Stopping SQLExpress service

    I am using the following line to create a serviceControllerSQL type.
    Code:
    ServiceController serviceControllerSQL = new ServiceController("MSSQLSERVER");
    I then check to see if the service is running and if so close it down.

    My question is :

    What happens if SQLExpress 2005 and SQLServer 2000 are running on the same machine. How can I just choose the Express service to stop ?

    When I look at the services running on my machine I can only find MSSQLSERVER.

    Parksie

  2. #2

  3. #3

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Re: Stopping SQLExpress service

    I cannot see SQLEXPRESS antwhere in my list of services. However I can find a "SQL Server (SQLEXPRESS)" entry.

    "SQL Server (SQLEXPRESS)" doesnt look to me like an appropriate handle for this.

    Most unusual.

    Parksie

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Stopping SQLExpress service

    It's easy enough to get a list of the services on your machine with the ServiceController.GetServices method. You can use that in your app or you can just use it during development to determine the name of the service you want to target.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424

    Re: Stopping SQLExpress service

    I was just googling about this and came across this knowledge base article. That article basically detects the status of the SQL Server Express service. They are using MSSQL$SQLEXPRESS as the service name.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width