问题描述
在我的Win应用程序中,有一个 ServerConnection
表单。
使用此 ServerConnection
表单,用户可以与 SQL Server 建立连接。
在 ServerConnection
表单中, Connect 按钮用于连接操作。我想应用 ProgressBar
控件,当用户点击 Connect 按钮 ProgressBar
控制将进行,然后建立与 SQL Server 的连接。我只写连接代码如下: -
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:-
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();
}
我不知道应该编写什么代码来使用此代码应用 ProgressBar
控件。
请提供代码来解决它。
I don't know what code should I write to apply ProgressBar
control with this code.
Please provide me code to solve it.
推荐答案
这篇关于在我的Windows应用程序中应用progressBar。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!