i want to execute 3 insert query in 3 different Tables. But these all 3 query are dependent to each other means when 1st query is executed successfully then there should be 2nd query execute and when 2nd query is executed successfully then there should be 3rd query is execute.
And if there is any Server Error or any Other type Error is occurred while executing the 2nd query then it must be delete all the records from database which is inserted by 1st query.
And if error occurred at the time of executing 3rd query (After successfully executed 1st and 2nd query) then there must be all records delete from database which is inserted by 1st and 2nd query.
Can i achieve this by execute delete query in Catch Block. Is it good idea ? or please give me a suggestion how i can achieve this because I am working in a live project so i can not take any risk. please response me soon.