0

Does SQLSERVER CE 4 support transactionscope?

In this example, I am using transactionscopeoption.suppress, so it does not do transaction.

createm and createb is a CRUD insert new record.

Below is my code:

// save merchant account & bank information into database
using (var transaction = new transactionscope(transactionscopeoption.suppress))
{
    try
    {
        viewmodel.merchantdata.createm(m);
        viewmodel.bankdata.createb(b);
        transaction.complete();
    }
    catch (exception ex)
    {
        // fail to save into database
        transaction.dispose();
    }
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
Alvin
  • 8,219
  • 25
  • 96
  • 177
  • Exact duplicate: http://stackoverflow.com/questions/4203358/sql-ce-4-system-transaction-support – Dennis Sep 13 '12 at 06:30
  • SQL CE does not support transaction scope. here is the answer http://stackoverflow.com/questions/5153573/error-on-using-transactionscope-in-ef4-sql-compact-4 – opewix Sep 13 '12 at 06:40
  • So How can I implement transaction for Entity Framewrok with SQL CE? – Alvin Sep 13 '12 at 06:47

0 Answers0