110,477
社区成员
发帖
与我相关
我的任务
分享
//pageStart 先定义开始读取位置如
int pageStart=0;
int n=0;
int pageSize=20;
当然这个你在上一页或下页的按钮事件中定义
pageStart=n*20
n+=1
public static DataTable AdapterFillTable(int pageStart, int pageSize, string SqlString)
{
SqlDataAdapter Adapter = new SqlDataAdapter();
DataTable Table = new DataTable();
using (SqlConnection connetion = new SqlConnection(connectionString))
{
Adapter.SelectCommand = new SqlCommand(SqlString, connetion);
Adapter.Fill(pageStart, pageSize, Table);
return Table;
}
}
调用返回Table再绑定到dataGridview