asp.net..Update语句有错吗??

来源:百度知道 编辑:UC知道 时间:2024/05/07 20:58:39
错误提示下面的Update语句语法有错.加10分
---------------------------------------------
void btnok_Click(Object Sender,System.EventArgs e)
{
OleDbConnection thisConnection=new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("../../dbs/webdata.mdb")+"");
thisConnection.Open();
OleDbCommand thisCMD=thisConnection.CreateCommand();
thisCMD.CommandText="Select password from logings where password='"+this.oldpsw.Text+"'";
OleDbDataReader thisReader=thisCMD.ExecuteReader();
if(thisReader.Read())
{
int b=1;
thisReader.Close();
OleDbCommand thisCMD2=thisConnection.CreateCommand();
thisCMD2.CommandText="Update logings set password='"+this.newpsw.Text+"' where id="+b+"";//错误提示这句Update语句语法有错。。会错吗?闷
thisCMD2.ExecuteNonQuery();
}
else
{lb4.Visible=true;}
thisConnection.Close();
}

thisCMD2.CommandText="Update logings set password='"+this.newpsw.Text+"' where id="+b;
就可以了阿,你后面多了点东西。

http://zhidao.baidu.com/q?word=asp.net..Update&ct=17&pn=0&tn=ikaslist&rn=10