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 multicast delegate in c#?
Why do you need boxing in c#?
Are c# strings immutable?
What is the difference between new and override in c#?
What is marshalling and what are different kinds of marshalling?
To create a localized application which namespaces are necessary?
What are class fields?
Is list a collection c#?
Define strong name in c#?
What is a cs file?
Can we make a Static Constructor Parameterized? Give Reason with your answer
Is c# still popular?
Is c sharp open source?
Is for loop faster than foreach?
Are multiple data types stored in System.Array?