Solved

Starting MS SQL Server 2000 from VB.NET application?

Posted on 2004-10-04
8
268 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 118
Support for Notepad++ (including downloading & installing a plugin) 5 205
ejb example issues 3 55
SQL Insert parts by customer 12 53
This is an explanation of a simple data model to help parse a JSON feed
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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 …

730 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