我的概念是,例如here[COU] =45
,然後進度條加載該計數,並希望顯示已成功完成。 但我沒有得到進展simultaneosly與計數在這裏工作並沒有顯示消息還,請幫我做的,我的代碼如下所示如何使用值來處理progressbar?
public void proget()
{
System.Data.DataRowView selectedFile =
(System.Data.DataRowView)dataGrid1.SelectedItems[i];
string iid = Convert.ToString(selectedFile.Row.ItemArray[10]);
SqlConnection con = new SqlConnection("Data Source=TNT3FMR\\SQLEXPRESS;Initial Catalog=xxx;Integrated Security=True");
string query = "SELECT [COU] FROM _Count_Series WHERE STUID='"+iid+"'";
SqlCommand cmd = new SqlCommand(query, con);
con.Open();
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
progressBar1.Value++;
}
MessageBox.Show("Completed Successfully");
}
幫我找忙做 – KesavuMenon