请教大家一个问题~~~
如何用ProgressBar来显示数据加载的进度,是否要用到多线程,怎么做,谢谢大家
用的是datagrid绑定代码如下:
private void binddata()
{
SqlConnection conn=database.connect(connstring);
string sqlstr="select * from "+this.table;
bt();
if(this.nowpage<1)
{
this.nowpage=1;
}
if(this.nowpage>this.pages)
{
this.nowpage=this.pages;
}
int StartIndex = (this.nowpage-1)*pagesize;
if(StartIndex<0)
{
StartIndex=0;
}
DataSet ds = new DataSet();
ds.Clear();
SqlDataAdapter MyAdapter = new SqlDataAdapter(sqlstr,conn);
MyAdapter.Fill(ds,StartIndex,this.pagesize,"user_info");
mygd.DataSource=ds;
mygd.DataMember="user_info";
label2.Text="当前:"+this.nowpage;
label3.Text="共计:"+this.pages;
label4.Text="页码:"+this.pagesize;
}