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

C#

 
AnswerRe: Directory Dialog Box?? Pin
Mazdak16-Apr-03 2:59
Mazdak16-Apr-03 2:59 
GeneralChange title bar color (or menu) Pin
mirano15-Apr-03 13:59
mirano15-Apr-03 13:59 
GeneralRe: Change title bar color (or menu) Pin
Chris Jobson15-Apr-03 23:06
Chris Jobson15-Apr-03 23:06 
GeneralRe: Change title bar color (or menu) Pin
mirano15-Apr-03 23:34
mirano15-Apr-03 23:34 
GeneralUnreachable Code Detected Pin
vinkoval15-Apr-03 12:43
vinkoval15-Apr-03 12:43 
GeneralRe: Unreachable Code Detected Pin
James T. Johnson15-Apr-03 13:27
James T. Johnson15-Apr-03 13:27 
GeneralRe: Unreachable Code Detected Pin
vinkoval15-Apr-03 18:52
vinkoval15-Apr-03 18:52 
GeneralRe: Unreachable Code Detected Pin
James T. Johnson15-Apr-03 19:01
James T. Johnson15-Apr-03 19:01 
k, the problem is that your if is checking a general case before a specific one; which is why the first part is always executed.

Specifically:

if( ... && City != "" ) the block following this will always be executed, unless City == "". The first block is executed even when City == null because null and "" are two different values so the first condition is met.

To correct this you need to switch the order of the two if statements. i.e. compare for null first, then compare for the empty string.

HTH,

James

"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation

GeneralSystem.Type usage Pin
S O S15-Apr-03 9:34
S O S15-Apr-03 9:34 
GeneralRe: System.Type usage Pin
Andres Manggini15-Apr-03 9:41
Andres Manggini15-Apr-03 9:41 
GeneralRe: System.Type usage Pin
S O S15-Apr-03 9:51
S O S15-Apr-03 9:51 
GeneralRe: System.Type usage Pin
James T. Johnson15-Apr-03 10:12
James T. Johnson15-Apr-03 10:12 
GeneralRe: System.Type usage Pin
leppie15-Apr-03 10:40
leppie15-Apr-03 10:40 
GeneralRe: System.Type usage Pin
James T. Johnson15-Apr-03 10:44
James T. Johnson15-Apr-03 10:44 
GeneralRe: System.Type usage Pin
S O S15-Apr-03 19:39
S O S15-Apr-03 19:39 
GeneralThis is sad Pin
RB@Emphasys15-Apr-03 7:32
RB@Emphasys15-Apr-03 7:32 
GeneralRe: This is sad Pin
Martin Cook15-Apr-03 7:45
professionalMartin Cook15-Apr-03 7:45 
GeneralRe: This is sad Pin
RB@Emphasys15-Apr-03 7:50
RB@Emphasys15-Apr-03 7:50 
QuestionCType in C#? Pin
monrobot1315-Apr-03 7:25
monrobot1315-Apr-03 7:25 
AnswerRe: CType in C#? Pin
RB@Emphasys15-Apr-03 7:46
RB@Emphasys15-Apr-03 7:46 
AnswerRe: CType in C#? Pin
Martin Cook15-Apr-03 7:51
professionalMartin Cook15-Apr-03 7:51 
AnswerRe: CType in C#? Pin
Andres Manggini15-Apr-03 8:42
Andres Manggini15-Apr-03 8:42 
AnswerRe: CType in C#? Pin
Atul Kale16-Apr-03 1:11
Atul Kale16-Apr-03 1:11 
AnswerRe: CType in C#? Pin
monrobot1316-Apr-03 4:15
monrobot1316-Apr-03 4:15 
GeneralRe: CType in C#? Pin
Atul Kale16-Apr-03 5:51
Atul Kale16-Apr-03 5:51 

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.