Click here to Skip to main content
15,912,897 members
Home / Discussions / C#
   

C#

 
AnswerRe: Data Transfer to new table Pin
Russell Jones18-Jan-07 22:54
Russell Jones18-Jan-07 22:54 
GeneralRe: Data Transfer to new table Pin
Bulky Fellow24-Jan-07 21:35
Bulky Fellow24-Jan-07 21:35 
QuestionBest way of stopping program after caught in catch{} Pin
livez18-Jan-07 21:49
livez18-Jan-07 21:49 
AnswerRe: Best way of stopping program after caught in catch{} Pin
Stefan Troschuetz18-Jan-07 21:57
Stefan Troschuetz18-Jan-07 21:57 
AnswerRe: Best way of stopping program after caught in catch{} Pin
quiteSmart18-Jan-07 21:58
quiteSmart18-Jan-07 21:58 
GeneralRe: Best way of stopping program after caught in catch{} Pin
livez18-Jan-07 22:24
livez18-Jan-07 22:24 
GeneralRe: Best way of stopping program after caught in catch{} Pin
quiteSmart18-Jan-07 22:36
quiteSmart18-Jan-07 22:36 
AnswerRe: Best way of stopping program after caught in catch{} Pin
Russell Jones18-Jan-07 22:33
Russell Jones18-Jan-07 22:33 
i would return a success state from method2. If the exception that you caught in method2 could reasonably be described as expected (file does not exist, server not available etc) then i would not rethrow the error. If , however, the error is unexpected I would rethrow the Error adding the original error as the inner exception of the new exception object.

Let's say string method2 () is a load file method

If the user cancels the dialog or the file is not a text file and can't be read then instead of returning a string containing the text from the file i return a null. Method1 sees a null and exits without carrying out further work. If while trying to open the file an unrecoverable error occurs let's say a "Your Harddisk has borked" Error then I create and throw an exception and let the main app deal with it.

I'm a great believer in only throwing errors as a last resort and trying to not use them in the expected flow of an application.

Russell
AnswerRe: Best way of stopping program after caught in catch{} Pin
Guffa18-Jan-07 22:37
Guffa18-Jan-07 22:37 
QuestionCan we Compare two folders according to size and date modified? Pin
tirumal123118-Jan-07 21:12
tirumal123118-Jan-07 21:12 
AnswerRe: Can we Compare two folders according to size and date modified? Pin
Luc Pattyn18-Jan-07 21:46
sitebuilderLuc Pattyn18-Jan-07 21:46 
AnswerRe: Can we Compare two folders according to size and date modified? Pin
Christian Graus18-Jan-07 21:53
protectorChristian Graus18-Jan-07 21:53 
AnswerRe: Can we Compare two folders according to size and date modified? Pin
Stefan Troschuetz18-Jan-07 21:53
Stefan Troschuetz18-Jan-07 21:53 
AnswerRe: Can we Compare two folders according to size and date modified? [modified] Pin
Michael Sterk18-Jan-07 22:07
Michael Sterk18-Jan-07 22:07 
GeneralRe: Can we Compare two folders according to size and date modified? Pin
arvmca18-Feb-09 0:44
arvmca18-Feb-09 0:44 
AnswerRe: Can we Compare two folders according to size and date modified? Pin
Luc Pattyn18-Jan-07 22:18
sitebuilderLuc Pattyn18-Jan-07 22:18 
GeneralRe: Can we Compare two folders according to size and date modified? Pin
Michael Sterk18-Jan-07 22:26
Michael Sterk18-Jan-07 22:26 
Questionhow to set location of control programatically?? Pin
Saira Tanwir18-Jan-07 19:49
Saira Tanwir18-Jan-07 19:49 
AnswerRe: how to set location of control programatically?? Pin
stancrm18-Jan-07 20:06
stancrm18-Jan-07 20:06 
GeneralRe: how to set location of control programatically?? Pin
Saira Tanwir18-Jan-07 20:19
Saira Tanwir18-Jan-07 20:19 
QuestionProblem updating datagrid of master form Pin
sopho2418-Jan-07 18:33
sopho2418-Jan-07 18:33 
QuestionRichTextBox Add/Remove Text Pin
et133718-Jan-07 14:36
et133718-Jan-07 14:36 
AnswerRe: RichTextBox Add/Remove Text Pin
Mircea Puiu19-Jan-07 1:19
Mircea Puiu19-Jan-07 1:19 
Questionhow to fax a txt file? Pin
Eddymvp18-Jan-07 12:42
Eddymvp18-Jan-07 12:42 
AnswerRe: how to fax a txt file? Pin
Judah Gabriel Himango18-Jan-07 13:09
sponsorJudah Gabriel Himango18-Jan-07 13:09 

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.