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
Why singleton pattern is used in c#?
Why data types are important?
What does using system mean in c#?
Can you mark static constructor with access modifiers?
What is threading in c# with example?
Can you create an instance of a static class?
What is console readkey in vb net?
What does console readkey do in c#?
Can list contain duplicates c#?
What is the difference between asp net and c#?
What is strong name in c# and how can we use it?
Why do we use public static void main in c#?
How can encapsulation be achieved?
Define Abstract Class in C#
What is escape sequence in c#?