SqlTransaction has completed; it can no longer be used

Trans.Rollback() in catch; just remove it. Because the previous trans.Commit(); has already been done, this means that the thing has ended, and of course the previous problem will occur when it is called later.  
In addition, there is no need to specify trans.Rollback(), if there is an exception, things will be automatically rolled back

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325251842&siteId=291194637