Chinaunix首页 | 论坛 | 博客
  • 博客访问: 775843
  • 博文数量: 156
  • 博客积分: 5320
  • 博客等级: 大校
  • 技术积分: 1605
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-09 12:24
文章分类

全部博文(156)

文章存档

2010年(20)

2009年(46)

2008年(21)

2007年(21)

2006年(33)

2005年(10)

2004年(5)

分类: WINDOWS

2006-01-13 10:36:46

This piece of code returns a collection of SQL Servers found on the local network.

Public Class clsSQLDMO
    Public Function GetListOfSQLServers(ByRef colSQLServers As Collection) As Boolean
        Dim iIndex As Integer
        Dim oSQLServer As New SQLDMO.SQLServer()
        Dim oServerList As SQLDMO.NameList = oSQLServer.Application.ListAvailableSQLServers
        colSQLServers = New Collection()
        For iIndex = 1 To oServerList.Count
            colSQLServers.Add(oServerList.Item(iIndex).ToString)
        Next
        Return True
    End Function
End Class
阅读(1100) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~