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 yield in c#?
Perfect Example Of While And Do-While Loop In C#.Net ?
What is the use of generics in c#?
What is the benefit of interface in c#?
What is the use of iqueryable in c#?
What are reflections in c#?
What are get and set in c#?
Is c# an open source language?
What are the return types in c#?
Is the following code legal?
How do you escape a character?
What are the advantages of constructor?
What is difference between constants and read-only?
What is the use of xmlserializer?
Why data types are important in c#?