深圳网络营销学校:ASP.NET数据库修改问题

来源:百度文库 编辑:高校问答 时间:2024/05/07 02:18:58
string bookID=(string)Request.QueryString["codification"];
String updataCmd="update books set (bookname,author,price,isbn,concern,notes)values(@bookname,@author,@price,@isbn,@concern,@notes) where codification='"+bookID+"'";
SqlCommand istCmd=new SqlCommand(updataCmd,conn);
istCmd.Parameters.Add("@bookname",SqlDbType.VarChar,50).Value=bookname.Text;
........

UPDATA这一句应该怎么写才对啊(运行时提示是UPDATE这句有语法问题...)
.谢谢,看见的高手帮帮忙啊..

呵呵,你这UPDATE语句是不对的阿,应该这样写:

String updateCmd="update books set bookname=@bookname,author=@author,price=@price,isbn=@isbn,concern=@concern,notes=@notes where codification='"+bookID+"'";
SqlCommand istCmd=new SqlCommand(updateCmd,conn);
...

原来的updataCmd中间的更新的单词是错的欧:)