try { } catch(Exception ex) { }
try { connection.Open(); st = connection.BeginTransaction(); commandToFinding = new SqlCommand(sqlqueryToFinding, connection,st); if (numToFinding != 0) { st.Commit(); Response.Redirect("AddStudy.aspx?stid=" + StudyIDTextBox.Text); connection.Close(); } } catch(Exception) { st.Rollback(); // Exception happens here (This SqlTransaction has completed; it is no longer usable.) connection.Close(); }
catch ( InvalidOperationException e ) { // Perform task } catch ( Exception e ) { // Perform Task } finally { // Perform Talk }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)