daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Nov 17th, 2018 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub cmbServerName_DropDown(sender As Object, e As EventArgs) Handles cmbServerName.DropDown
  2.     Dim Server As String = String.Empty
  3.     Dim instance As Sql.SqlDataSourceEnumerator = Sql.SqlDataSourceEnumerator.Instance
  4.     Dim stable As System.Data.DataTable = instance.GetDataSources()
  5.     For Each row As System.Data.DataRow In stable.Rows
  6.         Server = row("ServerName")
  7.         If row("InstanceName").ToString.Length > 0 Then
  8.             Server = Server & "" & row("InstanceName")
  9.         End If
  10.         cmbServerName.Items.Add(Server)
  11.     Next
  12.     cmbServerName.SelectedIndex = cmbServerName.FindStringExact(Environment.MachineName)
  13. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top