Click here to Skip to main content
15,892,965 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to read the splitcontainers Programmatically ? Pin
Luc Pattyn23-May-11 4:49
sitebuilderLuc Pattyn23-May-11 4:49 
AnswerRe: How to read the splitcontainers Programmatically ? Pin
Dave Kreskowiak23-May-11 1:32
mveDave Kreskowiak23-May-11 1:32 
AnswerRe: How to read the splitcontainers Programmatically ? Pin
Blue_Boy23-May-11 1:38
Blue_Boy23-May-11 1:38 
AnswerRe: How to read the splitcontainers Programmatically ? Pin
Luc Pattyn23-May-11 3:32
sitebuilderLuc Pattyn23-May-11 3:32 
AnswerRe: How to read the splitcontainers Programmatically ? Pin
Subin Mavunkal23-May-11 20:28
Subin Mavunkal23-May-11 20:28 
Questionnested try catch Pin
Pranit Kothari22-May-11 22:21
Pranit Kothari22-May-11 22:21 
AnswerRe: nested try catch PinPopular
Richard MacCutchan22-May-11 22:53
mveRichard MacCutchan22-May-11 22:53 
AnswerRe: nested try catch Pin
Keith Barrow22-May-11 23:22
professionalKeith Barrow22-May-11 23:22 
Pranit Kothari wrote:
Instead of this why should I not always us base class 'Exception' and let .Net
Framework decide which exception has occurred?

To add to Richard's comment, by catching several exception types you can distinguish what has gone wrong (and depending upon the type, as Richard says , recover). If you just catch Exception you can't do this as easily, you also potentially hide things that are going wrong in your code, I've seen this:

try
{
  //Snip: Code that might throw an error here
}
catch
{
  //Ignore errors
}


This is appalling discipline. If you are worried about exceptions getting to the user (and my take is that as far as possible they never should) you can add "catch all" blocks (sometimes called Top Level Exception Handling), which at the minium should inform the user that something unexpected has gone wrong and (optionally, possibly dependant on build type) log the error/stacktrace somewhere. This[^] looks like a pretty good article on this strategy, but I think the Introduction unintentionally misleads the reader: this Top Level Exception Handling is really to catch unhandled exceptions, you should really catch those you can where they are called and deal with them there.

AnswerRe: nested try catch [modified] Pin
Subin Mavunkal22-May-11 23:59
Subin Mavunkal22-May-11 23:59 
GeneralRe: nested try catch Pin
Keith Barrow23-May-11 0:26
professionalKeith Barrow23-May-11 0:26 
AnswerRe: nested try catch Pin
RobCroll23-May-11 12:33
RobCroll23-May-11 12:33 
QuestionDatagridview in Search Pin
ismail2022-May-11 21:44
ismail2022-May-11 21:44 
AnswerRe: Datagridview in Search Pin
Richard MacCutchan23-May-11 1:28
mveRichard MacCutchan23-May-11 1:28 
QuestionHow to declare the KeyPress Event to All RichTextBoxes...? Pin
Paramu197322-May-11 21:27
Paramu197322-May-11 21:27 
AnswerRe: How to declare the KeyPress Event to All RichTextBoxes...? Pin
Wayne Gaylard22-May-11 22:12
professionalWayne Gaylard22-May-11 22:12 
AnswerRe: How to declare the KeyPress Event to All RichTextBoxes...? Pin
RobCroll22-May-11 22:16
RobCroll22-May-11 22:16 
GeneralRe: How to declare the KeyPress Event to All RichTextBoxes...? Pin
ismail2022-May-11 22:22
ismail2022-May-11 22:22 
GeneralRe: How to declare the KeyPress Event to All RichTextBoxes...? Pin
Paramu197322-May-11 23:01
Paramu197322-May-11 23:01 
QuestionHow to generate fix header report with SSRS Pin
Tridip Bhattacharjee22-May-11 20:32
professionalTridip Bhattacharjee22-May-11 20:32 
QuestionHow to force a generic type eventhandler to a ingeneric one? [modified] Pin
JUNEYT22-May-11 12:17
JUNEYT22-May-11 12:17 
AnswerRe: How to force a generic type eventhandler to a ingeneric one? Pin
Alan N22-May-11 23:59
Alan N22-May-11 23:59 
GeneralRe: How to force a generic type eventhandler to a ingeneric one? Pin
JUNEYT23-May-11 2:29
JUNEYT23-May-11 2:29 
QuestionDllImport issue in c sharp Pin
shivamkalra22-May-11 9:45
shivamkalra22-May-11 9:45 
AnswerRe: DllImport issue in c sharp Pin
Luc Pattyn22-May-11 10:17
sitebuilderLuc Pattyn22-May-11 10:17 
AnswerRe: DllImport issue in c sharp Pin
Mark Salsbery22-May-11 12:59
Mark Salsbery22-May-11 12:59 

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.