[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

Starting MS SQL Server 2000 from VB.NET application?

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
ascendit
Asked:
ascendit
  • 2
  • 2
2 Solutions
 
frodomanCommented:
shell ("net start mssqlserver",AppWinStyle.Hide,False)
0
 
cavehopCommented:
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
 
deepaknetCommented:
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
 
cavehopCommented:
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
 
frodomanCommented:
I agree - recommend split frodoman / cavehop

0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now