Visual Basic.NET
  Home arrow Visual Basic.NET arrow Can We Integrate Visual Basic.NET, SQL Ser...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Can We Integrate Visual Basic.NET, SQL Server 2000 and WMI?
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 6
    2005-11-09

    Table of Contents:
  • Can We Integrate Visual Basic.NET, SQL Server 2000 and WMI?
  • How to connect to SQL Server 2000 using WMI
  • How to retrieve “Databases” information in SQL Server instance
  • How to retrieve “tables” information in SQL Server instance

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Can We Integrate Visual Basic.NET, SQL Server 2000 and WMI?


    (Page 1 of 4 )

    This article mainly explains how to integrate WMI with SQL Server 2000, together with the Visual Basic.NET language.

    A downloadable file for this article is available here: (http://images.devshed.com/af/stories/Integrate_
    VB_SQL_WMI/example.zip
    ). 

    The sample downloadable solution (zip) is entirely developed using Visual Studio.NET 2003 Enterprise Architect on Windows Server 2003 Standard Edition together with SQL Server 2000 Enterprise Edition.  But, I am confident that it would work with other versions of Windows (which support .NET 1.1) as well.

    WMI with SQL Server 2000?

    Recently, I received a question from one of the readers about whether WMI can be used with the SQL Server 2000 database.  That question really brought me up on my toes, so I immediately started an article to achieve the same.  Not every developer would know that we can manage SQL Server 2000 using WMI. Another question you might want to ask would be “Is it really necessary to work with WMI?”  The answer would be that it is not quite necessary.  You have SQL-DMO, which is quite well matured as compared with WMI (of course it cannot even compare).  I already introduced SQL-DMO at the following link.

    http://www.aspfree.com/c/a/VB.NET/Simple-BackupRestore-
    Utility-With-SQLDMO-Using-VBNET/

    SQL-DMO is generally used only by SQL server developers and not by system administrators.  What if the system administrator wants to access SQL server database information using a common programming model?  The answer would be WMI, because WMI is specially made with them (and also with WBEM) in mind.  And I introduced WMI with Visual Basic.NET at the following link.

    http://www.aspfree.com/c/a/VB.NET/WMI-Programming-
    with-Visual-BasicNET-Breaking-the-Ice/

    As everyone knows by now, WMI is the initiative for WBEM (Web Based Enterprise Management) to fulfill Microsoft's vision.  It has nearly entered into the market of system administrators at the moment.  But, in the future, there is no doubt that it would further penetrate into the developer’s world as well. WMI is mainly used to manage tasks. The tasks may not be related to a single piece of software or component.  WMI almost works with every Microsoft product. 

    Just imagine that you have Microsoft products already designed into about 15 to 20 servers (for various scenarios) and you would like to manage several instances of all of them using a common “language.”  And WMI achieved it.  WMI can work with almost all of them (as almost all of those servers support WMI internally). 

    And another exciting point about WMI is that you can work with it using either VBScript at the command prompt (or ASP for the web) together with WSH (Windows Script Host), or you can develop very effective applications using the .NET framework. The .NET framework fully supports WMI natively (which is also good news for ASP.NET developers who develop web applications).

    As I already introduced the concept of WMI in several articles at this site, I am not going to cover any fundamentals of WMI in this article.  In this article, I mainly focus on programming WMI using Visual Basic.NET, with the target server as SQL Server 2000 (which is not well-known to many developers).

    More Visual Basic.NET Articles
    More By Jagadish Chaterjee


       · Hello guys...I opened the doors of WMI even to the level of SQL Server 2000..Have a...
       · Hi jagdesh, The article explained me more about the use of WMI calls in...
       · Hai Gupta! I am very happy that it helped you. Thanks very much, bye.
     

    VISUAL BASIC.NET ARTICLES

    - User-defined Functions using Visual Basic Ap...
    - Understanding Object Binding in VBA
    - Mastering the Message Box
    - Testing a Windows Forms Application
    - Using Visual Basic.NET Features to Code a Wi...
    - Correcting Code in a Windows Forms Applicati...
    - Write Readable Code and Comments for Windows...
    - How to Code and Test a Windows Forms Applica...
    - Adding Features to a Windows Forms Applicati...
    - How to Design a Windows Forms Application
    - LINQ to XML Programming Using Visual Basic.N...
    - Understanding Delegates using Visual Basic.N...
    - Create a Sudoku Puzzle Generator using VB.NET
    - Entity Creation and Messaging in a VB.NET Te...
    - Movement and Player Statistics in a VB.NET T...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek