-1

//如果你点击一行,它将被删除

 string sqlStr = "DELETE from Members MemberID, FirstName, LastName, Phone, Mobile, Email, Address, Suburb, City, PostalCode, DateJoined;";
 sqlStr += "WHERE rowid=@Rowid;";
4

4 回答 4

1
string sqlStr = "DELETE from Members WHERE rowid=@Rowid";
于 2012-06-26T10:15:02.750 回答
0

DELETE 操作的语法不需要包含列名。

DELETE FROM <table_name> WHERE <condition>

在你的情况下,

string sqlStr = "DELETE from Members WHERE rowid=@Rowid";

我假设您已经@Rowid声明并指定为SqlParameter

于 2012-06-26T10:20:06.893 回答
0

根据您的代码,您应该这样做:

string sqlStr = "DELETE from Members";
 sqlStr += " WHERE rowid=@Rowid;";
于 2012-06-26T10:16:54.697 回答
0

我认为您应该删除;第一行的 at 和。并删除这些字段名称。
只需使用

"delete from members where rowid=@Rowid"
于 2012-06-26T10:15:16.223 回答