Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6070489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:56:22+00:00 2026-05-23T09:56:22+00:00

I basically want to make this in my application, so our technicians have an

  • 0

enter image description here

I basically want to make this in my application, so our technicians have an easier time installing our software. So far, I made a form with 4 text boxes: Server name, user name, password, and a combo-box to select a database. Everything was pretty easy until the database selection code. Microsoft’s wizard is very efficient, there’s no wait time when the database combo box is being filled. Here’s the best i could come up with:

  Private Sub cmbDatabase_DropDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbDatabase.DropDown
    Dim databaselist As New DataSet
    Dim connection As SqlClient.SqlConnection
    If txtServer.Text <> "" And txtLogin.Text <> "" And txtPassword.Text <> "" Then

        Try
        connection = New SqlClient.SqlConnection("Data Source=" + txtServer.Text + ";Initial Catalog=master;User ID=" + txtLogin.Text + ";Password=" + txtPassword.Text + ";Connect Timeout=5")
            connection.Open()
        Catch ex As Exception
        End Try


        If Not connection.State = ConnectionState.Closed Then
            Dim command As New SqlClient.SqlDataAdapter("EXEC sp_databases", connection)
            command.Fill(databaselist)
            cmbDatabase.DataSource = databaselist.Tables(0)
            cmbDatabase.DisplayMember = "DATABASE_NAME"
        End If
    End If

That code gets the databases just fine, but obviously if an exception happens the whole screen locks up and it might take a while to recover depending on what the database error is. My question is, can I make mine just as cool/efficient as Microsoft’s?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:56:22+00:00Added an answer on May 23, 2026 at 9:56 am

    Sure you can. Microsoft just took some more time. All the tools they used are also at your disposal. Here are some clues:

    1. Process as much of the database queries as you can on a Non-UI thread. For example, when using SqlDataSourceEnumerator to find all of the SQL instances on the network, put it in a thread, or even better use the TPL and make it a cancelable Task. Put as much work on a non-UI thread so it doesn’t block. If it might be an operation that takes a while to return, display a dialog like “Searching” with a cancel button that cancels the Thread / Task.
    2. Better error handling. Handle exceptions and decide if they are useful to the user, or not.
    3. As far as getting databases, I’d stay away from a SqlDataAdapter and just use a reader. A Data Adapter is pretty heavyweight for such little information.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I basically want to make things easier by just looping LinkButtons instead of making
I want to make an application witch involves logging into google. It is basically
Basically I want to make sure I will always get the computer's name rather
Basically I want to make simple toggle program (that will be mapped to some
I want to make a site where there user can basically navigate the web
Basically, I want to make clicking anywhere on a page except in an input
I basically want to do this: grep 'example.com' www_log > example.com.YYYY-MM-DD-H:i:S.log ...with of course
I basically want to do this in code: PersonList myPersonList; //populate myPersonList here, not
I have a scenerio where I want to dynamically render a custom form object.
In my sample application, I have basically two threads. The main thread contains a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.