1

我有 2 张桌子

VendorProduct vp = new VendorProduct
            {
                VendorPartNo = txtVdrPartNoOrg10.Value
            };

Product p = new Product
            {
                MfgPartNo = lbMfgPartNoOrg10.Text,
                Description = txtDesOrg10.Text,
                Weight = Convert.ToDecimal(txtWeightOrg10.Value),
                VendorProducts = new System.Collections.ObjectModel.Collection<VendorProduct>() { vp }
            };

如何将Insert数据放入这些表中,例如

DataContext.AddObject("Product", p);
DataContext.SaveChanges();

怎么设置链接??

4

0 回答 0