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

public partial class newdetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
      Int32 newid = Convert.ToInt32(Request.QueryString["nid"]);
      string sql0 = "select * from news where nid=" + newid;
      string acon = System.Configuration.ConfigurationManager.AppSettings["strcon"].ToString();
      OleDbConnection oconn = new OleDbConnection(acon);
      OleDbDataAdapter oda = new OleDbDataAdapter(sql0, oconn);
      DataSet ds = new DataSet();
      oda.Fill(ds);
      DataRow dr = ds.Tables[0].Rows[0];
      lbltitle.Text = dr["ntitle"].ToString();
      lblcontent.Text = dr["ncontent"].ToString();
      if (dr["npic"].ToString() != "")
      {
        imgpic.ImageUrl = dr["npic"].ToString();
        imgpic.Visible = true;
      }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
      Response.Redirect("news.aspx");
    }
}
