用斷點測驗id值為空,但是頁面是可以打開的,而且網址也有id值。
如果這里的id值為空,下面的操作就無法進行,麻煩各位大佬幫幫忙!!!
----------------------------------------------------分割線--------------------------------------------------------------------------------------
protected void Page_Load(object sender, EventArgs e)
{
// 連接資料庫
SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString);
//顯示詳細新聞資訊
string id = Request["id"].ToString(); //斷點處
Session["id"] = Request["id"].ToString();
SqlDataAdapter adsa2 = new SqlDataAdapter("select * from tb_leftup_pic where id='" + id + "'", sqlcon);
DataSet adds2 = new DataSet();
adsa2.Fill(adds2);
this.DataList1.DataSource = adds2;
this.DataList1.DataBind();
sqlcon.Close();
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/214471.html
標籤:C#
上一篇:關于讀取txt文本內容的問題
