Solved

Starting MS SQL Server 2000 from VB.NET application?

Posted on 2004-10-04
8
234 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
Comment Utility
shell ("net start mssqlserver",AppWinStyle.Hide,False)
0
 
LVL 4

Assisted Solution

by:cavehop
cavehop earned 125 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I agree - recommend split frodoman / cavehop

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
linearIn  challenge 23 65
wordsWithoutList  challenge 24 73
bigHeights  challenge 13 55
countHi challenge 25 84
This article will show, step by step, how to integrate R code into a R Sweave document
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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 …

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now