-----------------------------------------------------------
New Message on MumbaiUserGroup
-----------------------------------------------------------
From: ParryBrookes
Message 1 in Discussion
Hello All!
I want to do record level transaction handling.
Please refer to following code:
<Transaction(TransactionOption.)> _
Public Class clsMain
Inherits ServicedComponent
Public Function ProcessImportedRecords(ds as dataset) As Boolean
Try
intRowCnt = ds.Tables(0).Rows.Count
' looping through the records.
For intLoopCnt = 0 To (intRowCnt - 1)
Try
dr = mainDs.Tables(0).Rows(intLoopCnt)
if condition1 then
'doing some Inserts/Updates.
elseif condition2 then
'doing some Inserts/Updates.
end if
*contextutil.setComplete*
catch e as exception
*contextutil.setAbort*
end try
Next
Catch e as exception
End try
end function
end class
Suppose there are 5 records which I am trying to process. and
If there is an exception occurred in 3rd record, then except
changes made to 3rd record, changes made to all other records
should be committed to DB.
whats happening now is, after processing 5th record, SetComplete
is talking place and its committing all changes, including 3rd
records changes.
Please help me. I am sure, I am making some stupid, fundamental
error. I have tried my best to explain the problem.
Waiting for your responses.
Regards,
Parry Brookes
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/mumbaiusergroup/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]