许明会的计算机技术主页

Language:C,C++,.NET Framework(C#)
Thinking:Design Pattern,Algorithm,WPF,Windows Internals
Database:SQLServer,Oracle,MySQL,PostSQL
IT:MCITP,Exchange,Lync,Virtualization,CCNP

导航

2011年3月9日

大容量数据传输UI无响应怎么办:异步查询大结果集!

摘要: 数据库管理程序中,如果涉及大容量的数据传输,在数据检索过程中可能导致UI无响应。这里模拟这个过程,并通过异步调用避免UI停滞问题。该示例有共有3个button和1个DataGridView控件,其中2个button用于分别正常检索数据和异步检索数据,另一个button用于绑定数据。异步调用实际是开启新的非UI线程处理数据,因此异步调用中弹出的对话框也是和用户UI没关系的。程序中让数据访问延时5秒,尝试拖动窗体看看效果。usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;u 阅读全文

posted @ 2011-03-09 16:19 许明会 阅读(699) 评论(0) 推荐(0)

DataGridView.DataSource=ArrayList 绑定示例

摘要: 用DataReader读取数据记录并填充到ArrayList,然后将DataGridView的DataSource绑定到ArrayList,就可以显示网格表数据了。代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Data.SqlClient;usingSystem.Collec 阅读全文

posted @ 2011-03-09 08:46 许明会 阅读(1100) 评论(0) 推荐(0)