想知道是否有人可以看到为什么我收到错误“未找到或更改行”。当我执行此 LINQ 查询时。
该行在那里并且数据正在被拾取,但是当涉及到更新时,我得到了上面提到的错误。
aboDataDataContext dc = new aboDataDataContext();
var orders = dc.GetOrderToAcknowledges;
//Get the TWE Order ID and Store in DB.
foreach (var order in orders)
{
int orderId = dc.amzOrders.Single(o => o.amzOrderId == order.amzOrderId).id;
DateTime now = DateTime.Now;
GetTWEOrderID(orderId, now.ToString());
amzOrder orderUpdate = dc.amzOrders.Single(o => o.id == orderId);
orderUpdate.acknowledged = true;
orderUpdate.lastUpdate = Convert.ToDateTime(now);
dc.SubmitChanges();
}