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

C#

 
GeneralRe: OleDb Error [UPDATED] Pin
Kevin Marois15-Jan-20 10:51
professionalKevin Marois15-Jan-20 10:51 
GeneralRe: OleDb Error [UPDATED] Pin
Eddy Vluggen15-Jan-20 12:15
professionalEddy Vluggen15-Jan-20 12:15 
GeneralRe: OleDb Error [UPDATED] Pin
Dave Kreskowiak15-Jan-20 12:50
mveDave Kreskowiak15-Jan-20 12:50 
GeneralRe: OleDb Error [UPDATED] Pin
Eddy Vluggen15-Jan-20 12:57
professionalEddy Vluggen15-Jan-20 12:57 
QuestionException Handling Question Pin
Kevin Marois14-Jan-20 18:53
professionalKevin Marois14-Jan-20 18:53 
AnswerRe: Exception Handling Question Pin
OriginalGriff14-Jan-20 21:19
mveOriginalGriff14-Jan-20 21:19 
AnswerRe: Exception Handling Question Pin
F-ES Sitecore14-Jan-20 22:49
professionalF-ES Sitecore14-Jan-20 22:49 
SuggestionRe: Exception Handling Question Pin
Richard Deeming15-Jan-20 0:38
mveRichard Deeming15-Jan-20 0:38 
Kevin Marois wrote:
C#
catch (Exception)
{
    throw;  
}
If your catch block is simply re-throwing the same exception, without adding any extra information to it, then you don't need the catch block at all.

And as Griff said, don't use throw new Exception(...); - use a specific exception type instead. Either one of the built-in exception types, or a custom exception type will do. That way, the calling code has a better chance of catching just the exceptions it can handle, without having to look at the Message to try to work out what the problem is.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

AnswerRe: Exception Handling Question Pin
Gerry Schmitz15-Jan-20 13:44
mveGerry Schmitz15-Jan-20 13:44 
QuestionHow to add text to a script tag at src using jQuery Pin
Member 1316600712-Jan-20 7:52
Member 1316600712-Jan-20 7:52 
AnswerRe: How to add text to a script tag at src using jQuery Pin
OriginalGriff12-Jan-20 10:25
mveOriginalGriff12-Jan-20 10:25 
Questioni need a c# project using interfaces about anything Pin
Ali Al Akbar Hachem12-Jan-20 4:23
Ali Al Akbar Hachem12-Jan-20 4:23 
AnswerRe: i need a c# project using interfaces about anything Pin
OriginalGriff12-Jan-20 4:25
mveOriginalGriff12-Jan-20 4:25 
AnswerRe: i need a c# project using interfaces about anything Pin
Luc Pattyn13-Jan-20 1:03
sitebuilderLuc Pattyn13-Jan-20 1:03 
QuestionAccess winforms application when user right click on a file Pin
Hero201812-Jan-20 1:54
Hero201812-Jan-20 1:54 
AnswerRe: Access winforms application when user right click on a file Pin
OriginalGriff12-Jan-20 2:20
mveOriginalGriff12-Jan-20 2:20 
GeneralRe: Access winforms application when user right click on a file Pin
Hero201812-Jan-20 9:48
Hero201812-Jan-20 9:48 
GeneralRe: Access winforms application when user right click on a file Pin
OriginalGriff12-Jan-20 10:23
mveOriginalGriff12-Jan-20 10:23 
GeneralRe: Access winforms application when user right click on a file Pin
Hero201812-Jan-20 12:22
Hero201812-Jan-20 12:22 
GeneralRe: Access winforms application when user right click on a file Pin
OriginalGriff12-Jan-20 22:07
mveOriginalGriff12-Jan-20 22:07 
QuestionHtmlAgilityPack - How to get the Value from the tag <div> into aspx.cs Pin
Member 1316600710-Jan-20 6:02
Member 1316600710-Jan-20 6:02 
AnswerRe: HtmlAgilityPack - How to get the Value from the tag <div> into aspx.cs Pin
Richard Deeming10-Jan-20 6:10
mveRichard Deeming10-Jan-20 6:10 
Questionhow to configure LED8 customer pole display? Pin
Member 122427179-Jan-20 22:13
Member 122427179-Jan-20 22:13 
AnswerRe: how to configure LED8 customer pole display? Pin
OriginalGriff9-Jan-20 22:37
mveOriginalGriff9-Jan-20 22:37 
AnswerRe: how to configure LED8 customer pole display? Pin
ZurdoDev10-Jan-20 1:01
professionalZurdoDev10-Jan-20 1:01 

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.