Passing ADO.NET transaction ByVal or ByRef?
Hi there!
Please clear my doubt.
I have the following code:
Code:
Sub MainProc()
open connection
SqlTrans=cn.begintrans(isolationlevel)
'Use MS data access block
SQLHelper.ExecuteNonQuery(SqlTrans,commandtype.storedprocedure,spname,myParameters)
call ChildProc(SqlTrans)
'exception handling here
'if exception then rollback
'else
'commit
End sub
'My doubt is on the following line: whether to use ByVal or ByRef
Sub ChildProc(ByVal TransObj as SqlTransaction)
'Use MS data access block here also
SQLHelper.ExecuteNonQuery(TransObj,commandtype.storedprocedure,spname,myParameters)
'Throw exception if any
End sub