Subject Using statement and transactions
Author Adriana Cass
Hi,

Please let me know if the bellow code is correct.
I mean connection is closed and disposed and transaction is rolled back and
closed and disposed in case of exception.
Any other suggestions are welcome.

Thank you,
Adrya



using (FbConnection c = new FbConnection(m_connection))
{
c.Open();

using (FbTransaction trans = c.BeginTransaction())
{
using (FbCommand cmd = new
FbCommand("DELETE_MESSAGES_QUEUE", c, trans))

{
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.Add("INQUEUENAME", queueName);


cmd.ExecuteNonQuery();
}
using (FbCommand cmd = new FbCommand("DELETE_QUEUE", c, trans))

{
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.Add("INQUEUENAME", queueName);


cmd.ExecuteNonQuery();
}
trans.Commit();

}


}


[Non-text portions of this message have been removed]