三层怎么用AspNetPager
DAL层如:
public static IList<Hotel> select_hBorough_View(int city_Id)
{
List<Hotel> list = new List<Hotel>();
string sql = "select hBorough from Hotel where hBelongCity=@city_Id ";
SqlParameter[] parameters = {
new SqlParameter("@city_Id", SqlDbType.Int,4)};
parameters[0].Value = city_Id;
DataTable table = DBHress.getDataSet(sql, parameters);
foreach (DataRow row in table.Rows)
{
Hotel h = new Hotel();
h.HBorough = (string)row["hBorough"];
list.Add(h);
}
return list;
}
BLL 层就省了吧
页面的cs
也就这样 this.Repeater1.DataSource = Tickets_Service.select_hBorough_View();
this.Repeater1.DataBind();
谁可以教我怎么在这里用 AspNetPager控件