Click here to Skip to main content
15,900,110 members
Home / Discussions / C#
   

C#

 
GeneralRe: I take exception to the way Visual Studio 2010 handles exceptions Pin
Bernhard Hiller2-Sep-11 5:00
Bernhard Hiller2-Sep-11 5:00 
GeneralRe: I take exception to the way Visual Studio 2010 handles exceptions Pin
Luc Pattyn2-Sep-11 6:20
sitebuilderLuc Pattyn2-Sep-11 6:20 
GeneralRe: I take exception to the way Visual Studio 2010 handles exceptions Pin
Columbus-MCSD2-Sep-11 14:02
Columbus-MCSD2-Sep-11 14:02 
GeneralRe: I take exception to the way Visual Studio 2010 handles exceptions Pin
MicroVirus3-Sep-11 18:15
MicroVirus3-Sep-11 18:15 
QuestionTextbox properties Pin
vanikanc1-Sep-11 15:43
vanikanc1-Sep-11 15:43 
AnswerRe: Textbox properties Pin
Dave Kreskowiak1-Sep-11 16:59
mveDave Kreskowiak1-Sep-11 16:59 
QuestionC#.net- two ways to access active directory code Pin
dcof1-Sep-11 12:19
dcof1-Sep-11 12:19 
AnswerRe: C#.net- two ways to access active directory code Pin
Dave Kreskowiak1-Sep-11 16:54
mveDave Kreskowiak1-Sep-11 16:54 
GeneralRe: C#.net- two ways to access active directory code Pin
dcof2-Sep-11 4:38
dcof2-Sep-11 4:38 
GeneralRe: C#.net- two ways to access active directory code Pin
Dave Kreskowiak2-Sep-11 11:16
mveDave Kreskowiak2-Sep-11 11:16 
QuestionC#.net error obtained from sql server Pin
dcof1-Sep-11 6:42
dcof1-Sep-11 6:42 
AnswerRe: C#.net error obtained from sql server Pin
Dave Kreskowiak1-Sep-11 7:47
mveDave Kreskowiak1-Sep-11 7:47 
GeneralMessage Removed Pin
1-Sep-11 8:52
dcof1-Sep-11 8:52 
GeneralRe: C#.net error obtained from sql server Pin
#realJSOP1-Sep-11 9:28
professional#realJSOP1-Sep-11 9:28 
AnswerRe: C#.net error obtained from sql server Pin
Luc Pattyn1-Sep-11 7:54
sitebuilderLuc Pattyn1-Sep-11 7:54 
GeneralRe: C#.net error obtained from sql server Pin
dcof1-Sep-11 8:52
dcof1-Sep-11 8:52 
AnswerRe: C#.net error obtained from sql server Pin
#realJSOP1-Sep-11 8:28
professional#realJSOP1-Sep-11 8:28 
0) Just put a try/catch block around your code and handle each exception individually.

1) You can get a list of possible exceptions off the MSDN web site (just google the class.method you're interested in).

2) Handle the exceptions you want to show the user, and pass on the ones you don't.

C#
try
{
    create connection
    open conn ection
    query the database
    do something with the data
}
catch (ThisException ex)
{
}
catch (ThatException ex)
{
}
catch (AnotherException ex)
{
}
finally
{
}


Go forth, and code.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997


Questionretrive data from GridView Pin
jashimu1-Sep-11 5:27
jashimu1-Sep-11 5:27 
AnswerRe: retrive data from GridView Pin
Abhinav S1-Sep-11 6:01
Abhinav S1-Sep-11 6:01 
Questionemail sender program : Unable to connect to the remote server Pin
bigz_100031-Aug-11 23:57
bigz_100031-Aug-11 23:57 
AnswerRe: email sender program : Unable to connect to the remote server Pin
Qendro1-Sep-11 1:29
Qendro1-Sep-11 1:29 
GeneralRe: email sender program : Unable to connect to the remote server Pin
bigz_10001-Sep-11 3:02
bigz_10001-Sep-11 3:02 
AnswerRe: email sender program : Unable to connect to the remote server Pin
Dave Kreskowiak1-Sep-11 3:56
mveDave Kreskowiak1-Sep-11 3:56 
GeneralRe: email sender program : Unable to connect to the remote server Pin
bigz_10001-Sep-11 5:24
bigz_10001-Sep-11 5:24 
QuestionWhat is an Integer Pin
Anubhava Dimri31-Aug-11 18:50
Anubhava Dimri31-Aug-11 18:50 

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.