Error on using TransactionScope in EF4 & SQL Compact 4

前端 未结 2 1951
悲哀的现实
悲哀的现实 2020-12-21 19:18
using (TransactionScope scope = new TransactionScope())
using (var context = new dwfEntities())
{
  var field = (from x in context.DynFields where x.Id == id select          


        
2条回答
  •  萌比男神i
    2020-12-21 20:09

    If the connection is opened outside of the transaction scope you need to explicitly call EnlistTransaction. You cannot implicitly use a connection with a transaction scope in SQL CE as described here

提交回复
热议问题