Click here to Skip to main content
15,896,201 members
Home / Discussions / C#
   

C#

 
GeneralXML and SQL Pin
Radgar11-Feb-05 11:29
Radgar11-Feb-05 11:29 
GeneralRe: XML and SQL Pin
Anonymous11-Feb-05 12:03
Anonymous11-Feb-05 12:03 
GeneralRe: XML and SQL Pin
Radgar11-Feb-05 15:31
Radgar11-Feb-05 15:31 
GeneralRe: XML and SQL Pin
Daniel Turini12-Feb-05 5:37
Daniel Turini12-Feb-05 5:37 
GeneralEditorAttribute not working when registered as com interop Pin
Lasse Johansen11-Feb-05 10:00
Lasse Johansen11-Feb-05 10:00 
Generalerror when calling FormsAuthentication.RedirectFromLoginPage Pin
brian5511-Feb-05 8:48
brian5511-Feb-05 8:48 
Generalswitch case from array Pin
.gonad11-Feb-05 7:49
.gonad11-Feb-05 7:49 
GeneralRe: switch case from array Pin
Jon Sagara11-Feb-05 8:35
Jon Sagara11-Feb-05 8:35 
The case label must be a constant. For example,

case "Los Angeles":

switch[^]
switch in the C# spec[^]

Looks like you just want to display the node's text if it equals one of the cities in the array. Try something like:

<br />
// snip<br />
if (cities[i].ToLower () == e.Node.Text.ToLower ())<br />
{<br />
    MessageBox.Show (e.Node.Text);<br />
}<br />
// snip<br />


That, and you also need to change your for loop: either start with i = 0, or change the condition to i <= cities.Length. Otherwise, the first array element will never be evaluated.


Jon Sagara
I bent my wookie.

My Articles


GeneralRe: switch case from array Pin
.gonad11-Feb-05 9:52
.gonad11-Feb-05 9:52 
GeneralThreads and exceptions Pin
Esmo200011-Feb-05 7:16
Esmo200011-Feb-05 7:16 
GeneralRe: Threads and exceptions Pin
Robert Rohde11-Feb-05 7:46
Robert Rohde11-Feb-05 7:46 
GeneralRe: Threads and exceptions Pin
Esmo200011-Feb-05 7:59
Esmo200011-Feb-05 7:59 
GeneralRe: Threads and exceptions Pin
Daniel Turini11-Feb-05 8:17
Daniel Turini11-Feb-05 8:17 
GeneralAsynchronous message processing Pin
Esmo200011-Feb-05 4:55
Esmo200011-Feb-05 4:55 
GeneralRe: Asynchronous message processing Pin
Esmo200011-Feb-05 7:15
Esmo200011-Feb-05 7:15 
GeneralVariable assignment problem... Pin
new_phoenix11-Feb-05 4:32
new_phoenix11-Feb-05 4:32 
GeneralRe: Variable assignment problem... Pin
Daniel Turini11-Feb-05 6:53
Daniel Turini11-Feb-05 6:53 
GeneralRe: Variable assignment problem... Pin
new_phoenix11-Feb-05 9:01
new_phoenix11-Feb-05 9:01 
GeneralTaskbarNotification display problems Pin
eynkram11-Feb-05 4:27
eynkram11-Feb-05 4:27 
GeneralRe: TaskbarNotification display problems Pin
eynkram17-Feb-05 3:52
eynkram17-Feb-05 3:52 
GeneralProblem while Working with XmlValidatingReader!!!!! Pin
abcxyz8211-Feb-05 4:01
abcxyz8211-Feb-05 4:01 
GeneralRe: Problem while Working with XmlValidatingReader!!!!! Pin
Phil Hobgen11-Feb-05 22:53
Phil Hobgen11-Feb-05 22:53 
GeneralAppDomain and ResolveEventArgs Pin
Marc Clifton11-Feb-05 3:24
mvaMarc Clifton11-Feb-05 3:24 
GeneralRe: AppDomain and ResolveEventArgs Pin
Daniel Turini11-Feb-05 7:01
Daniel Turini11-Feb-05 7:01 
GeneralRe: AppDomain and ResolveEventArgs Pin
leppie11-Feb-05 9:45
leppie11-Feb-05 9:45 

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.