Error handling and RollBack Transaction in SQLITE from SQL Statement

前端 未结 1 1540
遇见更好的自我
遇见更好的自我 2021-01-14 04:24

I\'m Altering multiple sqlite tables with SQL script by calling ExecuteNonQuery. I want to do this operation in transaction and want to roll it back when anything fails.

相关标签:
1条回答
  • 2021-01-14 04:54

    Please take a look at SQLite on conflict clause

    Start with BEGIN TRANSACTION

    You have to add ON CONFLICT ROLLBACK on your actions

    And COMMIT TRANSACTION at the end ;-)

    0 讨论(0)
提交回复
热议问题