0

C# Windows アプリケーションで Access データベースを使用しています。私のアプリケーションは、さまざまな方法を使用してデータベースのさまざまなテーブルを更新します。コード ブロックをトランザクション対応にしたいのですが、アクセスが TransactionScope をサポートしていません。これを行う他の方法はありますか?

私の既存のコード サンプル:

using (TransactionScope scope = new TransactionScope())
            {
                //If customer exists update it else Register new customer
                if (Customer.IsCustomerExists(cname) == true)
                    Customer.UpdateCustomerInfo(cname, cell, mobile, phone);
                else
                    Customer.RegisterNewCustomer(cname, cell, mobile, phone);

                //If source station not exists, Register new station
                if (Station.IsStationExists(source) == false)
                    Station.RegisterNewStation(source);

                //If destination station not exists, Register new station
                if (Station.IsStationExists(destination) == false)
                    Station.RegisterNewStation(destination);

                scope.Complete();
            }
4

0 に答える 0