public partial class ConventionList : System.Web.UI.Page
{ protected void Page_Load(object sender, EventArgs e)
{ if (!IsPostBack)
{ BindToDataList();
}
}
protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{ BindToDataList();
}
private void BindToDataList()
{ int pageIndex = this.AspNetPager1.CurrentPageIndex - 1;
int pageSize = 5;
this.AspNetPager1.PageSize = pageSize;
int firstPage = pageIndex * pageSize;
SqlConnection conn = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
string sql = "select M.ExhibitionID,M.SystemID,M.TitleValue,M.ContentValue,M.ScopeValue,M.OrganizerValue,Country.CountryName,Area.AreaName,E.ExhibitionID,E.HttpUrl,E.StartDT,E.EndDT,E.ImageUrl from Country left join Area on Country.CountryID=Area.CountryID left join Pavilion on Area.AreaID=Pavilion.AreaID left join Exhibition E on E.PavilionID=Pavilion.PavilionID left join MultiLangExpo M on M.ExhibitionID=E.ExhibitionID where M.SystemID=1 and E.TypeID=1 and E.deleted=0 and StartDT > getDate() order by StartDT Desc";
SqlDataAdapter da = new SqlDataAdapter(sql,conn);
DataSet ds = new DataSet();
da.Fill(ds, firstPage, pageSize, "listall");
DataTable dt = ds.Tables["listall"];
AspNetPager1.RecordCount = getCount();
rptList.DataSource = dt;
rptList.DataBind();
}
private int getCount()
{ SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);
string sql = "";
感谢您访问我们的网站,您可能还对以下资源感兴趣:
小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码