%@ Page Language="C#"%> <%@ Import NameSpace = "System" %> <%@ Import NameSpace = "System.Data" %> <%@ Import NameSpace = "System.Data.SqlClient" %> <%@ Import NameSpace = "System.Web.Configuration" %> <% string pageTest = Request["page"]; int page; //目前所在頁數. bool result = IsNumeric(pageTest); //page為空值或非數字. if (!result) { page = 1; } else { page = Convert.ToInt32(pageTest); } int pageAll; //總頁數. int pageSize = 12; //每頁筆數. int totleCount = 0; //總筆數 string orderby = "ID"; //排序依據-id. SqlConnection Conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["topicReader_ConnectionString"].ConnectionString); SqlCommand Cmd = new SqlCommand(); SqlDataReader dr = null; //1.select總筆數. string SelTotleComm = "SELECT COUNT([ID]) FROM [20160910_cheers_trending_film] WHERE [IsShow] = '1'"; Cmd = new SqlCommand(SelTotleComm, Conn); Conn.Open(); if (Cmd.ExecuteScalar() != null) { totleCount = (Int32)Cmd.ExecuteScalar(); } //close DB. if (Conn.State == ConnectionState.Open) { Conn.Close(); } %>
人氣:<%=likeCount %>
--%><%=InsertTime %>
作者/製作團隊:<%=name %>
<%=description%>
<%-- --%>