CreateEnumerationTransaction 方法
建立讀取認可交易,透過它列舉來自資料庫的變更。
命名空間: Microsoft.Synchronization.Data
組件: Microsoft.Synchronization.Data (在 Microsoft.Synchronization.Data.dll 中)
語法
'宣告
Protected Overridable Function CreateEnumerationTransaction As IDbTransaction
'用途
Dim returnValue As IDbTransaction
returnValue = Me.CreateEnumerationTransaction()
protected virtual IDbTransaction CreateEnumerationTransaction()
protected:
virtual IDbTransaction^ CreateEnumerationTransaction()
abstract CreateEnumerationTransaction : unit -> IDbTransaction
override CreateEnumerationTransaction : unit -> IDbTransaction
protected function CreateEnumerationTransaction() : IDbTransaction
傳回值
型別:System.Data. . :: . .IDbTransaction
用來列舉資料庫變更的交易。
範例
下列程式碼範例會覆寫此方法,並且設定在 Oracle 資料庫中啟用快照集行為的選項。
protected override IDbTransaction CreateEnumerationTransaction()
{
OracleTransaction trans = (OracleTransaction)this.Connection.BeginTransaction();
new OracleCommand("set transaction read only", (OracleConnection)this.Connection, trans).ExecuteNonQuery();
return trans;
}
Protected Overloads Overrides Function CreateEnumerationTransaction() As IDbTransaction
Dim trans As OracleTransaction = DirectCast(Me.Connection.BeginTransaction(), OracleTransaction)
New OracleCommand("set transaction read only", DirectCast(Me.Connection, OracleConnection), trans).ExecuteNonQuery()
Return trans
End Function