"update 新闻 set '标题'='"+ TextBox1.Text + '" ,'内容'='"+ TextBox2.Text + "' ,'作者' ='"+ TextBox3.Text + "'where '编号' ="+ newsID);
        Response.Redirect("ManageNews.aspx");

解决方案 »

  1.   

    "update 新闻 set 标题='"+TextBox1.Text+"',内容='"+TextBox2.Text+"',作者='"+TextBox3.Text +"' where 编号="+newsID);
    如楼上所说去掉字段的单引号,还有就是单引号和双引号要对应起来
      

  2.   

    标题='"+ TextBox1.Text.ToString() + '"
      

  3.   


    使用中文字段名,一般用[]括起来。
    另外这样写的话,如果TextBox1、TextBox2、TextBox3中,有任意一个文本框为空的话,你这个sql语句会报语法错误,最好这样写:string sql = "update [新闻] set [编号]=[编号] ";
    if(TextBox1.Text.Trim().Length > 0)
        sql += ", [标题]='" + TextBox1.Text.Trim() + "' ";
    if(TextBox2.Text.Trim().Length > 0)
        sql += ", [内容]='" + TextBox2.Text.Trim() + "' ";
    if(TextBox3.Text.Trim().Length > 0)
        sql += ", [作者]='" + TextBox3.Text.Trim() + "' ";
    sql += " where [编号]=" + newsID;
      

  4.   

    如果是mssql,尝试使用,并过滤用户输入单引号:"UPDATE [新闻] SET [标题] = '" + TextBox1.Text.Replace("'", "''") + "' ,[内容] = '" + TextBox2.Text.Replace("'", "''") + "' ,[作者] = '" + TextBox3.Text.Replace("'", "''") + "' WHERE [编号] =" + newsID
      

  5.   

    "update 新闻 set 标题='"+ TextBox1.Text + '" ,内容='"+ TextBox2.Text + "' ,作者 ='"+ TextBox3.Text + "' where 编号 ="+ newsID
      

  6.   

    楼主,你输出来一看不就知道错了吗?要不然就是楼主不太熟悉SQL语句吧,好像.net也刚入手吧,多看些基础的知识!
    string strSql =
    "update 新闻 set 标题='"+ TextBox1.Text + '" ,内容='"+ TextBox2.Text + "' ,作者 ='"+ TextBox3.Text + "' where 编号 ='"+newsID+"' ";