Click here to Skip to main content
15,891,431 members
Home / Discussions / C#
   

C#

 
GeneralFindNext on BindingSource Pin
jchalfant14-Apr-08 8:56
jchalfant14-Apr-08 8:56 
AnswerRe: FindNext on BindingSource Pin
jchalfant14-Apr-08 10:45
jchalfant14-Apr-08 10:45 
QuestionUnboxing Question Pin
jka34714-Apr-08 8:39
jka34714-Apr-08 8:39 
GeneralRe: Unboxing Question Pin
Pete O'Hanlon14-Apr-08 9:10
mvePete O'Hanlon14-Apr-08 9:10 
GeneralRe: Unboxing Question Pin
jka34714-Apr-08 9:23
jka34714-Apr-08 9:23 
GeneralRe: Unboxing Question Pin
PIEBALDconsult14-Apr-08 17:29
mvePIEBALDconsult14-Apr-08 17:29 
GeneralSystem.NullException Error Pin
tcombs0714-Apr-08 8:26
tcombs0714-Apr-08 8:26 
GeneralRe: System.NullException Error Pin
Luc Pattyn14-Apr-08 9:01
sitebuilderLuc Pattyn14-Apr-08 9:01 
Hi,

your code is not safe.
regKey initially is null, it is only some way down the try block it may get a non-null
value, yet you use it without any checking in the finally block.
Imagine OpenCon() fails, you'll drop into the finally without a valid regKey.
remedy: perform a null-test in the finally.

in future: add debug/log statements, or single-step through your code. You can easily
solve this kind of problems yourself.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.


GeneralRe: System.NullException Error Pin
tcombs0714-Apr-08 9:29
tcombs0714-Apr-08 9:29 
GeneralRe: System.NullException Error Pin
Luc Pattyn14-Apr-08 9:56
sitebuilderLuc Pattyn14-Apr-08 9:56 
GeneralSQL statement Pin
vanessa12314-Apr-08 8:08
vanessa12314-Apr-08 8:08 
GeneralRe: SQL statement Pin
Rob Philpott14-Apr-08 8:18
Rob Philpott14-Apr-08 8:18 
GeneralRe: SQL statement Pin
Rob Philpott14-Apr-08 8:19
Rob Philpott14-Apr-08 8:19 
GeneralSerializing object. Need Help. Pin
zaboboa14-Apr-08 6:33
zaboboa14-Apr-08 6:33 
GeneralRe: Serializing object. Need Help. Pin
Zoltan Balazs14-Apr-08 7:23
Zoltan Balazs14-Apr-08 7:23 
GeneralC#: WriteEncrypedFileRaw Pin
rreeeddbb14-Apr-08 6:28
rreeeddbb14-Apr-08 6:28 
GeneralWindows Service Installer Pin
Madmaximus14-Apr-08 6:28
Madmaximus14-Apr-08 6:28 
General"The given path's format is not supported." Pin
shivapriyak14-Apr-08 4:36
shivapriyak14-Apr-08 4:36 
GeneralRe: "The given path's format is not supported." Pin
Mark J. Miller14-Apr-08 4:48
Mark J. Miller14-Apr-08 4:48 
GeneralRe: "The given path's format is not supported." Pin
J4amieC14-Apr-08 5:42
J4amieC14-Apr-08 5:42 
GeneralRe: "The given path's format is not supported." Pin
Mark J. Miller14-Apr-08 6:11
Mark J. Miller14-Apr-08 6:11 
GeneralRe: "The given path's format is not supported." Pin
J4amieC14-Apr-08 6:20
J4amieC14-Apr-08 6:20 
GeneralRe: "The given path's format is not supported." Pin
Mark J. Miller14-Apr-08 6:29
Mark J. Miller14-Apr-08 6:29 
GeneralRe: "The given path's format is not supported." Pin
PIEBALDconsult14-Apr-08 8:33
mvePIEBALDconsult14-Apr-08 8:33 
GeneralRe: "The given path's format is not supported." Pin
Luc Pattyn14-Apr-08 5:11
sitebuilderLuc Pattyn14-Apr-08 5:11 

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.