|
|
|
Click here to copy the following block |
Sub SetCommandsTransaction(ByVal tran As IDbTransaction, _ ByVal ParamArray adapters() As IDataAdapter) If adapters.Length = 0 Then Return If TypeOf adapters(0) Is OleDbDataAdapter Then Dim daOledb As OleDbDataAdapter For Each daOledb In adapters If Not daOledb.UpdateCommand Is Nothing Then _ daOledb.UpdateCommand.Transaction = tran If Not daOledb.InsertCommand Is Nothing Then _ daOledb.InsertCommand.Transaction = tran If Not daOledb.DeleteCommand Is Nothing Then _ daOledb.DeleteCommand.Transaction = tran Next ElseIf TypeOf adapters(0) Is SqlDataAdapter Then Dim daSql As SqlDataAdapter For Each daSql In adapters If Not daSql.UpdateCommand Is Nothing Then _ daSql.UpdateCommand.Transaction = tran If Not daSql.InsertCommand Is Nothing Then _ daSql.InsertCommand.Transaction = tran If Not daSql.DeleteCommand Is Nothing Then _ daSql.DeleteCommand.Transaction = tran Next End If End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|