locked
Rollback in webmatrix RRS feed

  • Question

  • User-1378722245 posted

    Hi,

    I have below multiple execute using dynamic SQL statement i need to roll back if any one of the SQL statement fails. How can i rollback it ?

    var db = WebMatrix.Data.Database.Open("MyConnectionString");

    var data = db.Execute("update table1 set column1 = 'very difficult to rollback' where id = 007");

    var data = db.Execute("insert into movies (ID, Name) Values (007, 'New Bond'));

    Thanks in advance 

    -Ram

    Sunday, May 22, 2016 10:17 AM

Answers

  • User1853794821 posted

    Unfortunately, the WebMatrix Database helper does not support transactions

    http://erikej.blogspot.com/2011/01/comparison-of-sql-server-compact-4-and.html

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 22, 2016 1:53 PM