Click here to Skip to main content
15,921,793 members
Home / Discussions / C#
   

C#

 
GeneralRe: TripleDES encryption. Anyone want to help? Pin
Colin Angus Mackay18-Jan-06 11:39
Colin Angus Mackay18-Jan-06 11:39 
GeneralRe: TripleDES encryption. Anyone want to help? Pin
jbergetun19-Jan-06 10:21
jbergetun19-Jan-06 10:21 
QuestionWaiting for Event to fire Pin
Bralyan17-Jan-06 12:29
Bralyan17-Jan-06 12:29 
Questioncalculating fraction in c# Pin
two_man_only17-Jan-06 12:02
two_man_only17-Jan-06 12:02 
AnswerRe: calculating fraction in c# Pin
Christian Graus17-Jan-06 14:03
protectorChristian Graus17-Jan-06 14:03 
GeneralRe: calculating fraction in c# Pin
two_man_only24-Jan-06 12:02
two_man_only24-Jan-06 12:02 
GeneralRe: calculating fraction in c# Pin
Christian Graus24-Jan-06 12:04
protectorChristian Graus24-Jan-06 12:04 
GeneralRe: calculating fraction in c# Pin
two_man_only25-Jan-06 1:11
two_man_only25-Jan-06 1:11 
QuestionGracefully shutting down threads Pin
User 665817-Jan-06 11:44
User 665817-Jan-06 11:44 
AnswerRe: Gracefully shutting down threads Pin
CWIZO17-Jan-06 21:15
CWIZO17-Jan-06 21:15 
GeneralRe: Gracefully shutting down threads Pin
User 665818-Jan-06 2:12
User 665818-Jan-06 2:12 
GeneralRe: Gracefully shutting down threads Pin
CWIZO18-Jan-06 3:01
CWIZO18-Jan-06 3:01 
QuestionVS 2005 UK edition Pin
pieterman17-Jan-06 11:44
pieterman17-Jan-06 11:44 
AnswerRe: VS 2005 UK edition Pin
Christian Graus17-Jan-06 14:03
protectorChristian Graus17-Jan-06 14:03 
GeneralRe: VS 2005 UK edition Pin
pieterman18-Jan-06 7:03
pieterman18-Jan-06 7:03 
QuestionTry/Catch Variable Scoping Pin
RobertF5717-Jan-06 11:34
RobertF5717-Jan-06 11:34 
AnswerRe: Try/Catch Variable Scoping Pin
Guffa17-Jan-06 11:50
Guffa17-Jan-06 11:50 
Because, in some cases the rdr variable will not be set. If the ExecuteReader call fails, the rdr variable doesn't get a value. The compiler only lets you use a variable if it's certain that it always has a value.

You should also get the same error message on the line where you call rdr.Close().

In fact, you shouldn't call rdr.Close() at all in the catch section. If the code in the catch section is executed, the rdr variable certainly has no value.

Also, if you get an exception, you shouldn't let the code just go on and try to use the reader anyway, as there is no reader.

---
b { font-weight: normal; }

GeneralRe: Try/Catch Variable Scoping Pin
RobertF5717-Jan-06 11:55
RobertF5717-Jan-06 11:55 
AnswerRe: Try/Catch Variable Scoping Pin
Guffa17-Jan-06 12:14
Guffa17-Jan-06 12:14 
GeneralRe: Try/Catch Variable Scoping Pin
RobertF5717-Jan-06 12:38
RobertF5717-Jan-06 12:38 
QuestionSetup Project - Getting the user selected install directory Pin
dotnetprgrmmr17-Jan-06 11:28
dotnetprgrmmr17-Jan-06 11:28 
AnswerRe: Setup Project - Getting the user selected install directory Pin
Sasuko17-Jan-06 11:48
Sasuko17-Jan-06 11:48 
GeneralRe: Setup Project - Getting the user selected install directory Pin
dotnetprgrmmr17-Jan-06 12:00
dotnetprgrmmr17-Jan-06 12:00 
GeneralRe: Setup Project - Getting the user selected install directory Pin
Sasuko17-Jan-06 12:42
Sasuko17-Jan-06 12:42 
GeneralRe: Setup Project - Getting the user selected install directory Pin
dotnetprgrmmr18-Jan-06 6:09
dotnetprgrmmr18-Jan-06 6: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.