Home All Groups Group Topic Archive Search About
Author
11 Feb 2006 4:07 PM
ari
hey all,

i know i need a try catch in my method but do i put all the contents of my
method withing the try catch or should I just put some of the code?


thanks,
ari

Author
11 Feb 2006 4:49 PM
Mattias Sjögren
>i know i need a try catch in my method but do i put all the contents of my
>method withing the try catch or should I just put some of the code?

It depends on the purpose of catching the exception. Why do you need
the Try Catch block to begin with?


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Author
12 Feb 2006 6:02 PM
m.posseth
if you need all code in the try statement ?? this depends on the code   my
initial feeling would say include only the strict necessary code in it

only use try catch blocks if you really need to do so

try catch blocks have a lot of overhead and so make your program a lot
slower

it is better coding practice to check for yourself if possible


regards

Michel Posseth [MCP]




Show quoteHide quote
"ari" <a**@discussions.microsoft.com> schreef in bericht
news:424D4A2A-C894-4596-9738-B7B5887AD7CF@microsoft.com...
> hey all,
>
> i know i need a try catch in my method but do i put all the contents of my
> method withing the try catch or should I just put some of the code?
>
>
> thanks,
> ari
Author
14 Feb 2006 2:31 AM
ari
thanks everyone.

Show quoteHide quote
"ari" wrote:

> hey all,
>
> i know i need a try catch in my method but do i put all the contents of my
> method withing the try catch or should I just put some of the code?
>
>
> thanks,
> ari