Results 1 to 7 of 7

Thread: Sql Server and Database Listing

  1. #1
    ggoodson
    Guest

    Sql Server and Database Listing

    Does anyone know how to get a list of Sql Server's using VB.NET.
    Also once a user selects a particular server to give a list of databases.


    Cheers

  2. #2
    Member
    Join Date
    Jan 2002
    Location
    New Jersey
    Posts
    39

    hmmm...

    Any idea on this one yet... this is my question also

    Thanks,
    Jon

  3. #3
    Member
    Join Date
    Dec 2002
    Location
    Newcastle, Australia
    Posts
    42
    Hi,

    Add a reference to SQL DMO

    Dim oApp As SQLDMO.Application
    Dim oNames As SQLDMO.NameList

    oApp = New SQLDMO.Application()
    oNames = oApp.ListAvailableSQLServers

    Dim i As Integer
    For i = 1 To oNames.Count
    Me.cboServerName.Items.Add(oNames.Item(i))
    Next

  4. #4
    Member
    Join Date
    May 2002
    Location
    Malaysia
    Posts
    45
    Sorry for my interruption, actually i am looking for this as well. i have try the posted code but i get the following error message...

    QueryInterface for interface SQLDMO.NameList failed.

    do you have any idea about this?

  5. #5
    Member
    Join Date
    Dec 2002
    Location
    Newcastle, Australia
    Posts
    42
    Hi,

    You will probably need the latest version of sqldmo.dll. I guess if you update/install MS SQL Client Tools it should work.

  6. #6
    Member
    Join Date
    May 2002
    Location
    Malaysia
    Posts
    45
    Hi! thanks for your reply... but where can i find the update?

  7. #7
    Member
    Join Date
    Dec 2002
    Location
    Newcastle, Australia
    Posts
    42
    Mmmm,

    The Microsoft SQL Server website would be a good start.

    We downloaded it ages ago and keep a copy of the file laying around...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width