Click here to Skip to main content
15,895,142 members
Home / Discussions / C#
   

C#

 
GeneralRe: Try/Catch Opinions Pin
Eddy Vluggen23-Nov-11 7:51
professionalEddy Vluggen23-Nov-11 7:51 
GeneralRe: Try/Catch Opinions Pin
jschell25-Nov-11 9:03
jschell25-Nov-11 9:03 
AnswerRe: Try/Catch Opinions Pin
Eddy Vluggen25-Nov-11 10:08
professionalEddy Vluggen25-Nov-11 10:08 
GeneralRe: Try/Catch Opinions Pin
jschell25-Nov-11 12:36
jschell25-Nov-11 12:36 
GeneralRe: Try/Catch Opinions Pin
Ennis Ray Lynch, Jr.23-Nov-11 8:34
Ennis Ray Lynch, Jr.23-Nov-11 8:34 
GeneralRe: Try/Catch Opinions Pin
PIEBALDconsult23-Nov-11 8:37
mvePIEBALDconsult23-Nov-11 8:37 
GeneralRe: Try/Catch Opinions Pin
Luc Pattyn23-Nov-11 10:25
sitebuilderLuc Pattyn23-Nov-11 10:25 
GeneralRe: Try/Catch Opinions Pin
jschell25-Nov-11 9:01
jschell25-Nov-11 9:01 
mjackson11 wrote:
Is there a lot of overhead associated with these? 


Not unless there are in fact a lot of exceptions.

mjackson11 wrote:
Is there a better way to do this than having a block in each method?


That depends on what the application does and what you do in the block.

If you have a server that runs 24x7 and moves data from one remote source to another then sometimes there will be connection failures. In a case like that then the it must catch exceptions that originate from communication problems and continue.

If it is a console app that runs either pass/fail by a human and they are not supposed to run it unless everything is already working then catching an exception is optional. Maybe friendly but also an extreme case.

If the app needs to handle 3 sequential cases and all must pass then you must handle exceptions so that you can take some sort of action if step 3 fails after the first two succeeded.

When I write servers I catch almost everything so I can log it.

And so on...
GeneralRe: Try/Catch Opinions Pin
emardini27-Nov-11 16:38
emardini27-Nov-11 16:38 
QuestionManage Services On Another PC/Server Pin
Kevin Marois23-Nov-11 6:59
professionalKevin Marois23-Nov-11 6:59 
AnswerRe: Manage Services On Another PC/Server Pin
Matt U.23-Nov-11 9:26
Matt U.23-Nov-11 9:26 
GeneralRe: Manage Services On Another PC/Server Pin
Kevin Marois23-Nov-11 10:16
professionalKevin Marois23-Nov-11 10:16 
QuestionC# Find and Replace Pin
stefanere2k923-Nov-11 6:02
stefanere2k923-Nov-11 6:02 
AnswerRe: C# Find and Replace Pin
BobJanova23-Nov-11 6:16
BobJanova23-Nov-11 6:16 
AnswerRe: C# Find and Replace Pin
PIEBALDconsult23-Nov-11 7:26
mvePIEBALDconsult23-Nov-11 7:26 
SuggestionRe: C# Find and Replace Pin
Nevin Janzen23-Nov-11 7:30
Nevin Janzen23-Nov-11 7:30 
AnswerRe: C# Find and Replace Pin
BillWoodruff24-Nov-11 7:24
professionalBillWoodruff24-Nov-11 7:24 
QuestionHow to control Cell Value in DatagridView ... Pin
nassimnastaran23-Nov-11 5:25
nassimnastaran23-Nov-11 5:25 
AnswerRe: How to control Cell Value in DatagridView ... Pin
Dan Mos23-Nov-11 5:30
Dan Mos23-Nov-11 5:30 
GeneralRe: How to control Cell Value in DatagridView ... Pin
nassimnastaran23-Nov-11 6:31
nassimnastaran23-Nov-11 6:31 
AnswerRe: How to control Cell Value in DatagridView ...[modified] Pin
Dan Mos23-Nov-11 6:41
Dan Mos23-Nov-11 6:41 
GeneralRe: How to control Cell Value in DatagridView ... Pin
nassimnastaran23-Nov-11 6:46
nassimnastaran23-Nov-11 6:46 
AnswerRe: How to control Cell Value in DatagridView ... Pin
Dan Mos23-Nov-11 7:17
Dan Mos23-Nov-11 7:17 
GeneralRe: How to control Cell Value in DatagridView ... Pin
nassimnastaran23-Nov-11 7:40
nassimnastaran23-Nov-11 7:40 
Questiona hypothetical about use of custom Attributes in C# in WinForms Pin
BillWoodruff23-Nov-11 1:07
professionalBillWoodruff23-Nov-11 1:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.