Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. Private Sub Cbox_database_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbox_database.MouseClick
  2. Try
  3. Dim frmloading As New loading
  4. loading.Show()
  5. cbox_database.Items.Clear()
  6. loadInstances(cbox_database)
  7. Finally
  8. loading.Close()
  9. cbox_database.DroppedDown = True
  10. End Try
  11. End Sub
  12.  
  13. Sub loadInstances(cbox As ComboBox)
  14. Dim dt As DataTable = SqlDataSourceEnumerator.Instance.GetDataSources
  15. For Each dr As DataRow In dt.Rows
  16. cbox.Items.Add(String.Concat(dr("ServerName"), "", dr("InstanceName")))
  17. Next
  18. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement