Click here to Skip to main content
15,747,637 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my Win Application, there is a ServerConnection Form.

By using this ServerConnection Form the user can establish a connection with SQL Server.

In the ServerConnection Form a button "Connect" is used for connection operation. I want to apply a ProgressBar control, when the user will click the "Connect" button the ProgressBar control will progress then establish the connection to SQL Server. I write only the connection code are as follows:-
C#
if (comboBox1.Text == "SQL Server  Authentication")
{
    Class1.cs = "Data Source= " + System.Environment.MachineName + ";Initial Catalog=Kolkata_Dental;User ID=" + textBox2.Text + ";Password=" + textBox3.Text + "";
                
    SqlConnection con = new SqlConnection();
    con.ConnectionString = Class1.cs;
    con.Open();
    Class1.connection = true;
    MessageBox.Show("Connection estabilished Successfully!!!");
    con.Close();
    Home_Page frm = new Home_Page();
    frm.Show();
    this.Hide();
}

I don't know what code should I write to apply ProgressBar control with this code.
Please provide me code to solve it.
Posted
v2

1 solution

Take a look at the below articles and get the idea.

1. how to use progressbar control in windows application using c#.net[^].
2. ProgressBar[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900