【发布时间】:2010-06-21 09:11:21
【问题描述】:
我想从数据表或 sql 表中选择数据,或按 50 行列出 50 行。例如:
var list = from x in dtable select x ----->前 50 行单击 GridView 下一个 50 行的下一步按钮。超过 50 行点击下一步按钮来监控 GridView?
例如数据:
static DataTable GetTable()
{
//
// Here we create a DataTable with four columns.
//
DataTable table = new DataTable();
table.Columns.Add("Dosage", typeof(int));
table.Columns.Add("Drug", typeof(string));
table.Columns.Add("Patient", typeof(string));
table.Columns.Add("Date", typeof(DateTime));
//
// Here we add five DataRows.
//
table.Rows.Add(25, "Indocin", "David", DateTime.Now);
table.Rows.Add(50, "Enebrel", "Sam", DateTime.Now);
table.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now);
table.Rows.Add(21, "Combivent", "Janet", DateTime.Now);
table.Rows.Add(100, "Dilantin", "Melanie", DateTime.Now);
return table;
}
}
【问题讨论】:
标签: c# .net visual-studio visual-studio-2008 linq