Hi ,
Could u just confirm me ,the following way of using try catch block is valid one I mean the nested one.
try
{
//Insert the signature Value.
sqlQuery =
"Insert into signature values (@sign);select max(signatureid) from signature";command =
new SqlCommand(sqlQuery, connection);command.Transaction = transaction;
command.Parameters.AddWithValue(
"@sign", mailCollection.mailDetail[0].signature);signId =
Convert.ToInt32(command.ExecuteScalar());returnString =
"Success";}
catch (Exception ex){
try
{
transaction.Rollback();
}
catch (InvalidOperationException exp){
General.WriteLog(exp.Message.ToString());
}
DiposeObject();
General.WriteLog(ex.Message.ToString());returnString =
"Error Occurred";}
Also confrim me ,using of try catch block affect the performance in anyway.
If it is so,pls., let me know how to handle try catch block in effective manner.Thanks.