毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> net技术 >> 正文

linq to entity,entity sql不支持DML怎么办

更新时间:2012-7-4:  来源:毕业论文

公司正用linq to entity实现项目开发,我现在接手的任务是将一个表中的数据选择性的插入另一个表中,
无论是linq to entity、linq to sql还是entity sql好像都不支持 DML 语句(insert、update、delete);
我该怎么办啊,那位大哥有好办法啊,把我愁坏了。解决不了就只能一个字段一个字段的赋值了,那样我会疯掉的
表中字段太多了

Northwnd db = new Northwnd(@"c:\Northwnd.mdf");

// Query for a specific customer.
var cust =
    (from c in db.Customers
     where c.CustomerID == "ALFKI"
     select c).First();

// Change the name of the contact.
cust.ContactName = "New Contact";

// Create and add a new Order to the Orders collection.
Order ord = new Order { OrderDate = DateTime.Now };
cust.Orders.Add(ord);

// Delete an existing Order.
Order ord0 = cust.Orders[0];

// Removing it from the table also removes it from the Customer’s list.
db.Orders.DeleteOnSubmit(ord0);

// Ask the DataContext to save all the changes.
db.SubmitChanges();

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©chuibin.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。