获取同一网段内的SQL SERVER实例

 ArrayList arrSqlServer = new ArrayList();
            SQLDMO.ApplicationClass oApp = new SQLDMO.ApplicationClass();
            try
            {
                SQLDMO.NameList sList = oApp.ListAvailableSQLServers();
                if (sList != null)
                {
                    for (int i = 1; i <= sList.Count; i++)
                        arrSqlServer.Add(sList.Item(i));
                }
            }
            finally
            {
                oApp = null;
            }
原文地址:https://www.cnblogs.com/elzero/p/869321.html