using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;

public partial class pagecount : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string sql = "select * from A_Message";
            DataSet dr;
            if (ISDatabase.SelectDatebase() == 1)
                dr = DbHelp.Query(sql);
            else
                dr = DbHelperOleDb.Query(sql);

            if (dr.Tables[0].Rows.Count > 0)
            {
                int pagenumber = 6;
                int count = Convert.ToInt32(dr.Tables[0].Rows.Count.ToString());
                string pageCount = Math.Ceiling((double)count / (double)pagenumber).ToString();
                Response.Write(pageCount);
            }
            else
            {
                Response.Write("0");
            }
        }
    }
}