如何在填充数据集时显示winform中进度计算的进度条?

时间:2012-10-29 16:00:48

标签: data-structures progress-bar winforms-interop

这是我的代码我想在datagridview.Plz中填充数据集和数据时加载进度条帮助我

private void btnLoad_Click(object sender,EventArgs e)         {

        string str="select Cert_ID,Card_Number,Name,DOB,Mobile,Gender,Relation ";
        str = str + " from dbo.beneficiary";



        SqlConnection conn = null;

        SqlDataAdapter sqlda = null;

        DataSet res = new DataSet();
        DataTable dt = new DataTable();
        try
        {
            _connectionString = "xyz.........";
            conn = new SqlConnection(_connectionString);
            conn.Open();
            SqlCommand command = new SqlCommand(str, conn);

            sqlda = new SqlDataAdapter(command);

            sqlda.Fill(res);


            dataGridView1.DataSource=res.Tables[0];




        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }

        finally
        {
            conn.Close();
        }


    }

0 个答案:

没有答案