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 reflection in c#?
Is string a data type in c#?
What is Delegate and what is it used for ?
What is a generic method?
Explain About CLS?
What is difference between singleton and static class in c#?
What is the main usage of keyword “virtual†? How does it work for a method or property?
Are there constructors in c sharp?
What is difference between il and dll ?
Describe the parts of assembly.
Tell me the difference between call by value and call by reference.
What is the system namespace?
What is datarelation c#?
What is the difference between int16 and int32 in c#?
Why do we use struct in c#?