且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Linq 2 SQL,将具有关联子对象列表的对象插入数据库,Silverlight RIA

更新时间:2021-09-10 03:27:47

您是从头开始创建订单行吗?如果是这样,则需要确保它们是新的,并且要为要添加的每个OrderLine调用Context.OrderLines.InsertOnSubmit(orderLine),否则会遇到类似问题.另外,您应该在此处提供所有异常详细信息...

Are you creating OrderLines from scratch? If so, you need to make sure that if they're new, that you're calling Context.OrderLines.InsertOnSubmit(orderLine) for each OrderLine you're adding, or you'll get problems like this. Also, you should provide all exception details here...