I have a combo box which help me select SQL servers in my local computer, but now I want it to be able to select just any connected servers (like remote servers) as possible, how could I solve it???
Sub server(ByVal str As String)
con = New SqlConnection("Data Source=" & str & ";Database=Master;integrated security=SSPI;")
con.Open()
cmd = New SqlCommand("select * from sysservers where srvproduct='SQL Server'", con)
dread = cmd.ExecuteReader
While dread.Read
cmbservername1.Items.Add(dread(2))
End While
dread.Close()