ios11控制中心在哪里:请问ASP.NET 怎么读取数据库中字段

来源:百度文库 编辑:神马品牌网 时间:2024/05/07 11:23:31
private void Button1_Click(object sender, System.EventArgs e)
{
try
{
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source= "+Server.MapPath("admin.mdb"));
con.Open();
OleDbCommand com = new OleDbCommand("select * from admin where user='"+TextBox1.Text+"'and paw='"+TextBox2.Text+"'",con);
if(com.ExecuteScalar()!=null)
{
Session["kk"]=this.TextBox1.Text.ToString();
con.Close();
Response.Redirect("admin.aspx");
}
else
{
Response.Redirect("weblogin.aspx");
}
}
catch (Exception ee)
{
Response.Write(ee.Message.ToString());
}
}

请问以上语句如果想加多一个Session["Popedom"],(Popedom 在数据库已经有这个字段了)
应该怎样添加呢?

什么意思?再说清楚一点,要实现什么?