ArtID   Title    Author  Content  AddTime
 1      呜呜呜    旺旺   任溶溶    2009/7 2      宿舍      恩恩   高高挂    2009/9 3      呵呵      问问   乖乖狗    2010/1用SQL语句该如何对以上表的内容 进行 更新、删除~~~   例如:
string strSQL = "update article set'title'='+strTitle +'····后面不会写了~· 不知道where后面是写什么值

解决方案 »

  1.   

    随便你想改的那一行的任何一个值都行啊
    就写 strSql = "update article set title = ‘" + strTitle + "' where title = '呜呜呜'";
    或者 strSql = "update article set title = ‘" + strTitle + "' where ArtID = 1";都可以。
    只要满足一个条件就行了
    怕有重复的就写成这样:
    strSql = "update article set title = ‘" + strTitle + "' where ArtID = 1 and title = '呜呜呜'";
      

  2.   

    string UpdateSql="update article set title="+title+" author="+author+" content="+content+" where artID="+artID;
    string DeleteSql="delete from article where artID="+artID;
      

  3.   


    string strSQL = "update article set title='"+strTitle+"' where ArtID =1";
    或@Id,sqlparameter
      

  4.   

    where后面一定要填写值吗???  如果随意的修改某一行  where后面该怎么填写呢????
      

  5.   

    如果没有where条件的话,就会把set 后面字段的所有内容都修改的
      

  6.   

    where后面一定要填写值吗??? 如果随意的修改某一行 where后面该怎么填写呢????你不可能所有列的值都改掉吧,那样的话你就删掉了再插入算了。
    where后面就接一个你不改的值就是了。
      

  7.   

    我不是说把所有列的值都修改,而是set 字段名称='' 把这个字段名称的值都修改啦,就像你上面所说的修改某一行,对呀,如果没有条件判断的话,怎么确定是某一行,是吧?感觉你是不是初学数据库的,这个sql语句很普通的,建议你看下数据库的最基本的问题。