给定查询:
db.ExecuteCommand(
"UPDATE ForumUserStats SET Posts += {0} WHERE UserID = {1} AND ForumID = {2}",
-1, post.AuthorID, post.Forum.ID
);
StringBuilder
然后在一个
ExecuteCommand
陈述。
如何将上面这样的查询添加到字符串中,以便在以后执行,而不必
DataContext
有空吗?
请注意,
string.format
没有正确地将SQL的属性参数化(例如
DateTime
strings
).