|
楼主 |
发表于 2014-3-10 09:02:32
|
显示全部楼层
我在程序调用时的代码,飞哥你帮我看一下对不对
private void bind()
{
mysql = data_record.getcon();
string sql = "select ad_us_kh_uid as 编号,ad_us_kh_name as 姓名,ad_us_kh_sex as 性别,ad_us_kh_zz as 所属组织,ad_us_kh_photo1 as 公司电话,"
+ "ad_us_kh_photo3 as 电话_固话,ad_us_kh_sj as 手机,ad_us_kh_Email as E_mail,ad_us_kh_QQ as QQ,ad_us_kh_address as 地址 from add_user_kh";
OleDbDataAdapter da = new OleDbDataAdapter(sql, mysql);
DataTable dt = new DataTable();
da.Fill(dt);
//取总行数
user_page3.Count = dt.Rows.Count ;
//总页数
user_page3.PageCount = user_page3.Count / user_page3.PageSize;
if (user_page3.Count % user_page3.PageSize != 0)
user_page3.PageCount = user_page3.PageCount + 1;
//绑定数
add_user_kh_dgv.DataSource = dt;
}
public void add_user_kh_show_Load(object sender, EventArgs e)
{
//刷新分页方法
user_page3.RefreshData = bind;
bind();
} |
|