Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Get list of Servers and Databases?

Options
  • 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 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 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