Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从当前编辑行的某些单元格中删除值?_C#_Asp.net_Sql - Fatal编程技术网

C# 如何从当前编辑行的某些单元格中删除值?

C# 如何从当前编辑行的某些单元格中删除值?,c#,asp.net,sql,C#,Asp.net,Sql,在gridview行更新中,我想清除当前编辑行的某些列中的单元格值,因此这些值也应该从表数据中删除。我该怎么做 比如: I have a simple gridview: A sql datasource to bind data from table data to gridview. 我觉得这里有些混乱。如果要“detele”2列值,则只需将其设为null即可: SqlDataSource1.DeleteCommand = "Delete value from column1,column

在gridview行更新中,我想清除当前编辑行的某些列中的单元格值,因此这些值也应该从表数据中删除。我该怎么做

比如:

I have a simple gridview:
A sql datasource to bind data from table data to gridview.

我觉得这里有些混乱。如果要“detele”2列值,则只需将其设为null即可:

SqlDataSource1.DeleteCommand = "Delete value from column1,column2 where rowid=@rowid"; //I need the right statment
SqlDataSource1.Delete();
或者干脆删除整行

 UPDATE table
    SET column1 = null,
        column2 = null
  WHERE rowid = @rowid;

我觉得这里有些混乱。如果要“detele”2列值,则只需将其设为null即可:

SqlDataSource1.DeleteCommand = "Delete value from column1,column2 where rowid=@rowid"; //I need the right statment
SqlDataSource1.Delete();
或者干脆删除整行

 UPDATE table
    SET column1 = null,
        column2 = null
  WHERE rowid = @rowid;