【发布时间】:2008-09-22 12:19:10
【问题描述】:
例如。我可以写这样的代码吗:
public void InactiveCustomers(IEnumerable<Guid> customerIDs)
{
//...
myAdoCommand.CommandText =
"UPDATE Customer SET Active = 0 WHERE CustomerID in (@CustomerIDs)";
myAdoCommand.Parameters["@CustomerIDs"].Value = customerIDs;
//...
}
我知道的唯一方法是加入我的 IEnumerable,然后使用字符串连接来构建我的 SQL 字符串。
【问题讨论】: