简单问题!在线等!
从数据库中取一条数据,有username,password两列!
select username,password from users
where 条件
取出为一条数据。
生成DataTable对象 obData!
我想把取出的两列数据付给两个session对象!
形式如下:
Session["username"] = this.obData.Rows[1]["username"].ToString();
Session["username"] = this.obData.Rows[1]["password"].ToString();
or
Session["username"] = this.obData.Rows[1][1].ToString();
Session["username"] = this.obData.Rows[1][2].ToString();
都提示出错!
请兄弟姐妹们指点一下!有没有好的方法!急!