Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Get list of Servers and Databases?

  • 13-03-2008 11:45AM
    #1
    Closed Accounts Posts: 5,240 ✭✭✭


    I am creating a login screen for a small app im writing.
    I have two combo boxes, one for the server selection and one for the database selection.

    I am wondering if it is possible to populate the server combobox with a list of all the servers, and once the user has selected a server the database combobox is populated with all the databases on that server.
    Im guessing the connection would have to perform some sort of search function?

    At present i have just hard coded a few server and database names into the boxes, and then passed them as a connection string.
    I am using a UDL connection.

    Any help appreciated.
    Endo


Comments

  • Registered Users, Registered Users 2 Posts: 2,781 ✭✭✭amen


    yes you can do this
    if you the client you are installing on has SQL server installed then you can use the SQL server objects (DMO etc) to obtain server/database information

    if not look at using ODBC calls to search the network
    I wrote a little article on it
    http://www.codeproject.com/KB/database/SubmitSQLInfoEnumerator.aspx

    it can very interesting finding sql server on several machines that do not appear to have sql installed as third party apps have installed it

    post some code if you are stuck


  • Registered Users, Registered Users 2 Posts: 2,494 ✭✭✭kayos


    Sorry to correct you amen but you dont need SQL Server installed on the machine you wish to run this from. The DMO and related objects come as part of the Client tools not just the complete server install ;). Then when deploying you should be able to just deploy the dll's as part of your installer.

    Its been a while since I programmed against the DMO objects but still think you should get away with installing the client tools only.


  • Closed Accounts Posts: 5,240 ✭✭✭Endurance Man


    Thanks amen, worked a treat.


Advertisement