C # Sqlite Affairs

Sqlite database transaction execution in C # in two ways: Sql code and C # code

1.Sql Code:

BEGIN…

COMMIT

/ROLLBACK

2.C # Code:

the using (SQLiteConnection Conn = SqliteHelper.GetSQLiteConnection ()) 
            { 
                the DbTransaction Trans = conn.BeginTransaction ();
                 the try 
                { 
                     // the Sql statement 
                     trans.Commit (); // commit the transaction 
                 }
                 the catch (Exception E) 
                { 
                    trans.Rollback (); // roll back the transaction 

                }              }



SqliteHelper is a Sqlite database access tools category, in my " c # Sqlite help class have introduced" in the

Reproduced in: https: //www.cnblogs.com/OnlyVersion/p/3748015.html

Guess you like

Origin blog.csdn.net/weixin_34393428/article/details/93605627