J
JenHu
Hi experts,
I want to rollback the insert/update in my SQL Server database
tables if there's any errors, and I use trans.Rollback(). However,
whenever error generates, the rollback doesn't work at all, and it
throws this server error:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
can anyone tell me what does this go wrong? Thanks.
------------------------------------------------------
Dim trans As System.Data.SqlClient.SqlTransaction
Try
.........some codes...........
Catch exp As Exception
'rollback the transaction if any step above is not successful
trans.Rollback()
End Try
*---------------------------------*
Posted at: http://www.GroupSrv.com
Check: http://wwww.HotCodecs.com
*---------------------------------*
I want to rollback the insert/update in my SQL Server database
tables if there's any errors, and I use trans.Rollback(). However,
whenever error generates, the rollback doesn't work at all, and it
throws this server error:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
can anyone tell me what does this go wrong? Thanks.
------------------------------------------------------
Dim trans As System.Data.SqlClient.SqlTransaction
Try
.........some codes...........
Catch exp As Exception
'rollback the transaction if any step above is not successful
trans.Rollback()
End Try
*---------------------------------*
Posted at: http://www.GroupSrv.com
Check: http://wwww.HotCodecs.com
*---------------------------------*