sql
Publicado por indrema (13 intervenciones) el 06/05/2006 02:36:38
estoy intentando obtener las lista de servidores que tengo en el sql server....este es mi codigo
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' then retrieve the data sources.
Dim instance As SqlDataSourceEnumerator = SqlDataSourceEnumerator.Instance
Dim table As System.Data.DataTable = instance.GetDataSources()
'cmb2.Items.Add(instance.GetDataSources.Rows.Item(""))
' Filter the sources to just show SQL Server 2005 instances.
Dim rows() As DataRow = table.Select("Version LIKE '9%'")
ComboBox1.Items.Clear()
For Each row As DataRow In rows
Console.WriteLine(row("ServerName"))
'TextBox1.Text = row.Item("Servername")
ComboBox1.Items.Add(row("Servername"))
Next
'Console.WriteLine("Press any key to continue.")
'Console.Read()
End Sub
el problema es k solo me esta cargando un servidor y tengo 3 servidores registrados....si alguien me puede ayudar se los agradecere....bye saludos
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' then retrieve the data sources.
Dim instance As SqlDataSourceEnumerator = SqlDataSourceEnumerator.Instance
Dim table As System.Data.DataTable = instance.GetDataSources()
'cmb2.Items.Add(instance.GetDataSources.Rows.Item(""))
' Filter the sources to just show SQL Server 2005 instances.
Dim rows() As DataRow = table.Select("Version LIKE '9%'")
ComboBox1.Items.Clear()
For Each row As DataRow In rows
Console.WriteLine(row("ServerName"))
'TextBox1.Text = row.Item("Servername")
ComboBox1.Items.Add(row("Servername"))
Next
'Console.WriteLine("Press any key to continue.")
'Console.Read()
End Sub
el problema es k solo me esta cargando un servidor y tengo 3 servidores registrados....si alguien me puede ayudar se los agradecere....bye saludos
Valora esta pregunta


0