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
What is the purpose of a console table?
What is a dictionary in c#?
what is a static constructor?
What is c# best for?
What is default value of bool in c#?
What is the usage of transponders?
What is asynchronous one-way calls?
What is the use of xmlserializer?
How long will it take to learn c sharp?
What is the role of the datareader class in ado.net connections?
What is string concatenation?
Is string value type c#?
Does c# support c type macros?
In howmany ways can you deploy an assembly?
Is python easier than c#?