C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Try Catch Block


Posted Date: 05 Sep 2008      Total Responses: 6

Posted By: devipriya       Member Level: Bronze     Points: 1


Hi,


Is there any maximum no of Try Catch block in .net?

Regards,
Devipriya




Responses

Author: Abhishek Arya    05 Sep 2008Member Level: DiamondRating:     Points: 3
no you can put any number of try catch


Author: Subodh kumar Prajapati    05 Sep 2008Member Level: GoldRating:     Points: 3
There is no limit to put try catch block.


Author: ANIL PANDEY    05 Sep 2008Member Level: DiamondRating:     Points: 3
hi,

No there is no limit that u have to write only this much TRY CATCH block in ur application u can write any no of block in ur code..


Thanks
Anil


Author: Geetha    05 Sep 2008Member Level: GoldRating:     Points: 6
try
{
this.OpenConnection();
// dataAdapter.ReturnProviderSpecificTypes = true;
dataAdapter.FillSchema(ReturnDataTable, SchemaType.Source);
dataAdapter.Fill(ReturnDataTable);
}
catch (SqlException se)
{
//Exception handling will be implemented;
string ss = se.Message;
}
catch (Exception ex)
{
//Exception handling will be implemented;
string ss = ex.Message;
}
finally
{
this.CloseConnection();
}

like this you can have multiple catch blocks. No limit for catch blocks.



Author: G.Hemadribabu    05 Sep 2008Member Level: GoldRating:     Points: 6
hi devipriya

there is no limitation at all , you put try block and execute set of command, after completion of first try block , introduce second try block and again introduce set of commands to execute, it will automatically works after completion of the first try block

line by line execution takes place, so first try block will execute first, and second and so on ...

hope you are clear with my reply

thank you
hemadribabu



Author: Lakhan Pal    05 Sep 2008Member Level: GoldRating:     Points: 3
no such limit you can use as many try.. catch and catch block in a single try block.


Post Reply
You must Sign In to post a response.
Next : Image Map - Very Urgent
Previous : .Net Questions
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

web conferencing services

Contact Us    Privacy Policy    Terms Of Use