SQLCE3.5資料庫的事物處理,sqlce3.5資料庫事物

來源:互聯網
上載者:User

SQLCE3.5資料庫的事物處理,sqlce3.5資料庫事物

今日瀏覽MSDN偶然所得,(一直以為SQLCE不支援事物)。

相信很多WINCE開發的人員和我一樣,直接用 sqlce.excute("begin tran") 卻發現,語法錯誤,就以為SQLCE不支援。

其實這是T-SQL慣性思維所致。下面示範如何使用:(環境 .NET35 + SQLCE35 + XP + VS2008)

 sqlce.open();//開啟SQLCE資料庫,意思一下,真實代碼不想寫。

//正式開始

SqlCeTransaction m_tran = sqlce.BeginTransaction();//開始事物,這個和 T-SQL不一樣封裝成類了。

//執行你的語句(省略)這裡和 T-SQL基本上沒差別

m_tran.Rollback();//復原操作

。。。。。。。

m_tran.Commit();//事物提交

*************************************************完畢,看不懂的別問,有相關基礎的人一看就明白!******************************

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.