[获取当前局域网内所有SQL主机]和[检查本机是否存在SQL服务器]源码!
'获取当前局域网内SQL服务器
Dim mySQL As Sql.SqlDataSourceEnumerator = Sql.SqlDataSourceEnumerator.Instance
For A As Integer = 0 To mySQL.GetDataSources.Rows.Count - 1
listbobox.item.add((mySQL.GetDataSources.Rows(A).Item(0)) )
Next
'检查本机是否存在SQL服务器(接上经过小小的修改就可以了HOHO!!)
Dim mySQL As Sql.SqlDataSourceEnumerator = Sql.SqlDataSourceEnumerator.Instance
For A As Integer = 0 To mySQL.GetDataSources.Rows.Count - 1
If My.Computer.Name = (mySQL.GetDataSources.Rows(A).Item(0)) Then
MsgBox("本机存在SQL")
End If
Next