none
pulling up server names in .Net RRS feed

  • Question

  • Hi,

    I am trying to pull up the server names of Oracle and MySql
    in a similar way as the Visual Studio management Studio does.
    I want this to be implemented in on of my forms in the application.
    I figured out with SQL Server and the code is below. Some how even that doesnt seem to work perfectly.
    Thanks in advance.

    SQLDMO.Application sqlApp = new SQLDMO.ApplicationClass();
    SQLDMO.NameList sqlServers = sqlApp.ListAvailableSQLServers();
    for(int i=0;i<sqlServers.Count;i++)
    {
    object srv = sqlServers.Item(i + 1);
    if(srv != null)
    {
    this.cboServers.Items.Add(srv);
    }
    }
    if(this.cboServers.Items.Count > 0)
    this.cboServers.SelectedIndex = 0;
    else
    this.cboServers.Text = "<No available SQL Servers>";
    Monday, July 16, 2007 3:47 PM