我有一个ACCESS数据库,里面有3000多一点的记录,想使用DATAGRIDVIEW显示出来,结果查询数据库很快(<1秒),但是显示的速度却很慢,要三分钟左右,哪怕我只选择1个字段,这几天实在没招了,求救我的计算机配置
P42.4HT
1G内存下面是我的程序代码
ds = new DataSet ( );
da.SelectCommand.CommandText = strSql;
da.Fill ( ds , "right" );
dataGridView1.DataSource = ds.Tables[ "right" ];
P42.4HT
1G内存下面是我的程序代码
ds = new DataSet ( );
da.SelectCommand.CommandText = strSql;
da.Fill ( ds , "right" );
dataGridView1.DataSource = ds.Tables[ "right" ];
SqlCommand1.CommandText = strSql;
conn.Open();
dt.Load(SqlCommand1.ExecuteReader(CommandBehavior.CloseConnection);
dataGridView1.DataSource = dt;
不用DataBind
两者速度是有区别,但不是像lz描述那样明显
da.SelectCommand.CommandText = strSql;
this.Cursor = Cursors.Hand;
da.Fill ( ds , "right" );
this.Cursor = Cursors.WaitCursor;
dataGridView1.DataSource = ds.Tables[ "right" ];
this.Cursor = Cursors.Default;变成Hand后不到秒就变成了waitcursor,然后要等好几分钟后才出数据