-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: rajbaba_0
Message 1 in Discussion
HI everybody I am facing problem in batch updating the record in a same transaction
. in the time of execution of comit its working problem but if any error while
updating its goes to exception and executing rollback its giving the error thats is
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION. and i am
pasting my code down
ObjConn.Open()
ObjTrans = ObjConn.BeginTransaction
Try
'ObjTrans.Save("tran1")
For LintLoop = 0 To lstSite.Items.Count - 1
StrSql = "Insert Into tbl_UP_UserFavoriteSites_Tr (WebSiteUrl,UserId) Values ('" &
lstSite.Items(LintLoop).Text & "'," & userID & ") "
sqldataCommd =new Command(StrSql, ObjConn, ObjTrans)
sqldataCommd.ExecuteNonQuery()
Next
' ObjTrans.Rollback()
ObjTrans.Commit()
'IF added removing items
txtUrl.Text = ""
If lstSite.Items.Count > 0 Then
lstSite.Items.Clear()
Dim IArr As Integer
Dim LstItm(10) As String
ICount = 0
End If
LblRes.Text = "Web site added"
LblRes.Visible = True
Catch ex As Exception
ObjTrans.Rollback()
lblMessage.Text = ex.Message
lblMessage.Visible = True
Finally
'ObjTrans.Rollback("tran1")
'ObjTrans.Commit()
ObjConn.Close()
End Try
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_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]