using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;

namespace mdEngergy
{
    public partial class ztList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                string strClassId = "";

                if (Request.QueryString["ClassId"] != null)
                    strClassId = Request.QueryString["ClassId"].ToString().Trim();
            
            string strConnection = @"Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("DB_51aspx\\Data.mdb");
            //创建数据库连接对象
            OleDbConnection myconn = new OleDbConnection(strConnection);
            myconn.Open();
            //创建查询语句
            string sql = "select * from news where BigClassId=" + strClassId + " order by addtime desc";

            //创建数据库命令
            OleDbCommand mycmd = new OleDbCommand(sql, myconn);
            OleDbDataReader result = mycmd.ExecuteReader();

            rp1.DataSource = result;
            rp1.DataBind();
            myconn.Close();
            }

        }


    }
}
