尝试使用类型数组int传递参数时遇到问题.到目前为止我做了什么,但两种方法都失败了.
方法1(失败):
int[] CategoryArray; CategoryArray = new int[userItem.ListItemId.Count()]; int i=0; foreach (int catID in userItem.ListItemId) { CategoryArray[i] = catID; i++; } db.Database.ExecuteSqlCommand("delete from SupportRegion where UserId={0} and CategoryID not in ({1})", userItem.UserId, CategoryArray);
方法2(也失败):
db.Database.ExecuteSqlCommand("delete from SupportRegion where UserId={0} and CategoryID not in ({1})", userItem.UserId, String.Join(",", userItem.ListItemId));
如何将参数定义为整数数组?
非常感谢