rt
我在csdn上找了一下,没有找到合适的答案,请各位高人指点一下,谢谢!

解决方案 »

  1.   

    有很多啊,
    引用 SQLDMO 的,怎么会没找到?
      

  2.   

    ArrayList arrSqlServer = new ArrayList();
                SQLDMO.ApplicationClass oApp = new SQLDMO.ApplicationClass();
                try
                {
                    SQLDMO.NameList sList = oApp.ListAvailableSQLServers();
                    if(sList != null)
                    {
                        for(int i=0;i < sList.Count;i++)
                            arrSqlServer.Add(sList.Item(i).ToString());
                        listBox1.DataSource = arrSqlServer;
                    }
                }
                finally
                {
                    arrSqlServer = null;
                    oApp = null;
                }
      

  3.   

    更正:for(int i=1;i<=sList.Count;i++)