我有这个功能从数据库中显示记录到FlowLayoutPanel的极限记录
flowLayoutPanel1.Controls.Clear();
using (SqlConnection myDatabaseConnection = new SqlConnection(myConnectionString.ConnectionString))
{
myDatabaseConnection.Open();
string a = "Select EmpID, Name from EmpTable";
using (SqlCommand SqlCommand = new SqlCommand(" "+ a +" ", myDatabaseConnection))
{
int i = 0;
SqlDataReader DR1 = SqlCommand.ExecuteReader();
while (DR1.Read())
{
i++;
BookUserControl usercontrol = new BookUserControl();
usercontrol.Tag = i;
usercontrol.EmpID = DR1["EmpID"].ToString();
usercontrol.Name = (string)DR1["Name"];
flowLayoutPanel1.Controls.Add(usercontrol);
}
}
}
我如何将限制将在FlowLayoutPanel中显示的记录数?我知道有选择顶部。但是,我将如何做到这一点,例如将显示10条记录,当点击下一个按钮时,将显示接下来的10条记录,当前一个按钮点击时,将显示前10条记录。
什么是数据库? Oracle,Sql Server 2000/2005/2008? – unlimit
帮助? http://stackoverflow.com/a/658570/1134076 –
sql server 2008 :) –