Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Starting MS SQL Server 2000 from VB.NET application?

Posted on 2004-10-04
8
263 Views
Last Modified: 2010-04-17
I want to start the MS SQL Server from my VB.NET application. By starting i mean like if i first open the servers SERVIVE MANAGER TOOL and then starting the server by the RUN button.
0
Comment
Question by:ascendit
  • 2
  • 2
8 Comments
 
LVL 42

Accepted Solution

by:
frodoman earned 125 total points
ID: 12221199
shell ("net start mssqlserver",AppWinStyle.Hide,False)
0
 
LVL 4

Assisted Solution

by:cavehop
cavehop earned 125 total points
ID: 12221322
If you are running the VB.NET application on the server, then you can use the Shell command to start and stop the service.  For example:

Dim intProcID As Integer
intProcID = Shell("net start mssqlserver", AppWinStyle.NormalFocus)

If you want to make sure that the command is completed before continuing in your code:
intProcID = Shell("net start mssqlserver", AppWinStyle.NormalFocus, True)

--Lance--
0
 
LVL 15

Expert Comment

by:deepaknet
ID: 12234323
You can use the Interop of SQLDMO to manage and control the servers:

Check out this URL:
http://www.15seconds.com/issue/010618.htm

deepak
0
 
LVL 4

Expert Comment

by:cavehop
ID: 12505164
All three answers, frodoman's, deepaknet's, and mine, are effective solutions to the problem (frodoman's and mine are substantially the same, though he beat me to the punch by a few minutes).

--Lance--
0
 
LVL 42

Expert Comment

by:frodoman
ID: 12505207
I agree - recommend split frodoman / cavehop

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an explanation of a simple data model to help parse a JSON feed
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question