If we write return statement in finally block will it works
fine or throws any error?
Answer Posted / mahesh kotekar
Answer Is NO. We cannot have return in finally block...
we get the following error.
Control cannot leave the body of a finally clause
returns void, a return keyword must not be followed by an
object expression
try
{
First.DoSomething1();
First.DoSomething2();
}
catch (Exception)
{
throw;
}
finally
{ return 0; }
| Is This Answer Correct ? | 5 Yes | 3 No |
Post New Answer View All Answers
Explain linq to entities? : Entity framework
I want to fetch data from datareader. i have three tables in datareader. i want to bind my two table with datagrid, then i want to fetch a value from my third table. do u have any idea pls help me. we use dr.nextresult() for multiple tables.
What is basic authentication in web api?
how to disable the lazy loading framework?
What you mean by routing in mvc?
What is an asynchronous controller in asp.net mvc?
What is conceptual model? : Entity framework
Is it possible to create a custom filter?
How does servicing work for the .net framework 3.0?
Give an example for authorization filters in an asp.net mvc application?
Which are the important namespaces used in ASP.Net MVC?
i want to take the fast track training on >net Frame work and work flows and share point could you tellme the good institutes for that cources
What is mvc entity framework?
What are the advantages of mvc over asp.net?
How can I return string result from action in asp.net mvc?