菜鸟语法错误,急,在线等
lzt7 2005-08-25 09:54:38 string Sqlstr="Update PE_User set SpareEmail='" + SpareEmail.Text + "',Homepage='" + Homepage.Text + "',QQ='" + QQ.Text + "',ICQ='" + ICQ.Text + "',MSN='" + MSN.Text + "',Yahoo='" + Yahoo.Text + "',UC='" + UC.Text + "',Aim='" + Aim.Text + "',OfficePhone='" + OfficePhone.Text + "',HomePhone='" + HomePhone.Text + "',Fax='" + Fax.Text + "',Mobile='" + Mobile.Text + "',Country='" + Country.Text + "',Province='" + Province.Text + "',City='" + City.Text + "',Address=='" + Address.Text + "',ZipCode='" + ZipCode.Text + "',TrueName='" + TrueName.Text + "',Birthday='" + Birthday.Text + "',IDCard='" + IDCard.Text + "',Vocation='" + Vocation.Text + "',Company='" + Company.Text + "',Department='" + Department.Text + "',PosTitle='" + PosTitle.Text + "',Marriage='" + rBtListMarriage.SelectedItem.Value + "',Income='" + Income.Text + "',UserFace='" + UserFace.Text + "',FaceWidth='" + FaceWidth.Text + "',FaceHeight='" + FaceHeight.Text + "',Sign='" + Sign.Text + "',Privacy='" + rBtPrivacy.SelectedItem.Value + "' where UserName='" + Session["UserName"] + "'";
SqlCommand mycommand=new SqlCommand(Sqlstr,con);
con.Open();
mycommand.ExecuteNonQuery();
con.Close();
错在哪里???
贴上错误信息:
第 1 行: '=' 附近有语法错误。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Data.SqlClient.SqlException: 第 1 行: '=' 附近有语法错误。
源错误:
行 251: SqlCommand mycommand=new SqlCommand(Sqlstr,con);
行 252: con.Open();
行 253: mycommand.ExecuteNonQuery();
行 254: con.Close();
行 255: }
源文件: d:\web\lzt7\admin\user_login.aspx.cs 行: 253
堆栈跟踪:
[SqlException: 第 1 行: '=' 附近有语法错误。]
System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
lzt7.Admin.User_Login.btnFinish_Click(Object sender, EventArgs e) in d:\web\lzt7\admin\user_login.aspx.cs:253
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()