Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to extend defalutl MessageBox properties in c# Pin
OriginalGriff10-Sep-09 3:20
mveOriginalGriff10-Sep-09 3:20 
GeneralRe: how to extend defalutl MessageBox properties in c# Pin
musefan10-Sep-09 3:12
musefan10-Sep-09 3:12 
AnswerRe: how to extend defalutl MessageBox properties in c# Pin
carlecomm23-Sep-09 1:01
carlecomm23-Sep-09 1:01 
QuestionException in finally black ??? Pin
md_azy10-Sep-09 2:26
md_azy10-Sep-09 2:26 
AnswerRe: Exception in finally black ??? Pin
musefan10-Sep-09 2:33
musefan10-Sep-09 2:33 
AnswerRe: Exception in finally black ??? Pin
Manas Bhardwaj10-Sep-09 2:36
professionalManas Bhardwaj10-Sep-09 2:36 
AnswerRe: Exception in finally black ??? Pin
Arun Jacob10-Sep-09 2:38
Arun Jacob10-Sep-09 2:38 
AnswerRe: Exception in finally black ??? Pin
Nagy Vilmos10-Sep-09 2:48
professionalNagy Vilmos10-Sep-09 2:48 
Specifically for your example, you could use a try/catch inside finally, thus:

try {
  // do something
  // with con
}
catch (Exception ex) {
  // Ya boo sucks!
}
finally {
  try {
    con.close();
  }
  catch (Exception ex) {
    // unable to close it but must let go!
  }
  finally {
    // finally, finally release the reference
    con = null;
  }
}


Easy (and with tags too)



Panic, Chaos, Destruction.
My work here is done.

GeneralRe: Exception in finally black ??? Pin
Pete O'Hanlon10-Sep-09 3:08
mvePete O'Hanlon10-Sep-09 3:08 
GeneralRe: Exception in finally black ??? Pin
Nagy Vilmos10-Sep-09 3:38
professionalNagy Vilmos10-Sep-09 3:38 
GeneralRe: Exception in finally black ??? Pin
Henry Minute10-Sep-09 4:14
Henry Minute10-Sep-09 4:14 
AnswerRe: Exception in finally black ??? Pin
carlecomm23-Sep-09 0:55
carlecomm23-Sep-09 0:55 
QuestionWriting a custom exception and the "meaning" of the code Pin
Kaare Tragethon10-Sep-09 1:47
Kaare Tragethon10-Sep-09 1:47 
AnswerRe: Writing a custom exception and the "meaning" of the code Pin
Not Active10-Sep-09 1:51
mentorNot Active10-Sep-09 1:51 
GeneralRe: Writing a custom exception and the "meaning" of the code Pin
Kaare Tragethon10-Sep-09 2:00
Kaare Tragethon10-Sep-09 2:00 
QuestionNeed Help ! Pin
Jacobb Michael10-Sep-09 1:30
Jacobb Michael10-Sep-09 1:30 
AnswerRe: Webbrowser Control Pin
Arun Jacob10-Sep-09 1:32
Arun Jacob10-Sep-09 1:32 
GeneralRe: Webbrowser Control Pin
Jacobb Michael10-Sep-09 1:38
Jacobb Michael10-Sep-09 1:38 
GeneralRe: Webbrowser Control Pin
Arun Jacob10-Sep-09 1:50
Arun Jacob10-Sep-09 1:50 
GeneralRe: Webbrowser Control Pin
Jacobb Michael10-Sep-09 1:58
Jacobb Michael10-Sep-09 1:58 
AnswerRe: Need Help ! Pin
Not Active10-Sep-09 1:44
mentorNot Active10-Sep-09 1:44 
GeneralRe: Need Help ! Pin
Jacobb Michael10-Sep-09 1:48
Jacobb Michael10-Sep-09 1:48 
QuestionIs any event available ? Pin
Jacobb Michael10-Sep-09 1:24
Jacobb Michael10-Sep-09 1:24 
AnswerRe: Is any event available ? Pin
Arun Jacob10-Sep-09 1:25
Arun Jacob10-Sep-09 1:25 
GeneralRe: Is any event available ? Pin
Jacobb Michael10-Sep-09 1:33
Jacobb Michael10-Sep-09 1:33 

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.