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 Policies : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string strConnection = @"Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("DB_51aspx\\Data.mdb");
            //创建数据库连接对象
            OleDbConnection myconn = new OleDbConnection(strConnection);
            //打开数据库连接(edit by 51aspx.com)
            myconn.Open();
            //创建查询语句
            string sql = "select * from News where BigClassId=10 order by AddTime desc";

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

///首发于51as/px.c/om