Answer Posted / khushnood alam
two catch block can be executed but need coresponding try
block
ex
DbTransaction Transaction = Connection.BeginTransaction();
try
{
RemoteDB.ExecuteNonQuery(cmdBfcNew,
Transaction);
if (Convert.ToInt64
(AddBfcNewOutgoingDetails["ID"]) == -1)
{
mID = Convert.ToInt64
(RemoteDB.GetParameterValue(cmdBfcNew, "@ReturnID"));
}
else
{
mID = Convert.ToInt64
(AddBfcNewOutgoingDetails["ID"]);
}
try
{
DbCommand cmdOutgoing =
LocalDB.GetStoredProcCommand
("usp_Outgoing2UpdateAfterUploadingData");
LocalDB.AddInParameter
(cmdOutgoing, "@AwbNo", DbType.String,
AddBfcNewOutgoingDetails["AwbNo"]);
}
catch (Exception Ex)
{
Transaction.Rollback();
Transaction1.Rollback();
return Ex.Message;
}
catch (Exception Ex)
{
Transaction.Rollback
();
return Ex.Message;
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Define method overloading in c#?
What is xslt in c#?
How to generate strong name key file or which command is used to generated strong name key file?
what is IDisposal interface,IComparable,IEquatable,IFormatable
Is c# substring zero based?
Why to use “using” in c#?
Why is hashset faster?
What is console writeline in c#?
What are the various components in crystal reports?
What is the difference between parse and tryparse in c#?
Can we inherit a private class in c#?
What is the file extension for c#?
Enlist all the components of an ado.net framework?
What is callback function in c#?
Can multiple inheritance implemented in c# ?