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 are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?
How to implement an object pool in c#.net.
How does dll hell solve in .net?
What is the difference between an integer and int?
Difference between call by value and call by reference in C#?
If you define a user defined data type by using the class keyword, is it a value type or reference type?
Show us in simple steps to create setup & deployment project for windows application?
What is difference between ienumerable and list in c#?
Difference between debug.write and trace.write?
What are delegates?
Different between method overriding and method overloading?
How does dictionary work in c#?
When To use HashTable In C#
Does unity use c++ or c#?
What is private virtual in C#?