C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2722
Number of posts: 5749

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Newbie desprite for help with swtch statement Posted by JudyLooking on 13 Mar 2003 at 9:28 AM
I'm getting this error of "a value of integral value type expected"

I have two radiobuttonlist I'm trying to get values from. The values are strings so I"m lost as to the problem here. I'm thinking this must be an array and I need to use 0,1,2,3... instead of the actaul value I gave each list.

heres the code:

switch (purposes)
{
case "FClass":
string purpose = FClass;
switch(techpath)
{
case "Intel":
string techpath = Intel;
break;
case "AMD":
string techpath = AMD;
break;
case "DualIntel":
string techpath = DualIntel;
break;
case "DualAMD":
string techpath = DualAMD;
break;
case "Hidden":
string techpath = Hidden;
break;
default:
Response.Write("You must select a Tech Path");
break;
}
break;
Report
Re: Newbie desprite for help with swtch statement Posted by Brutes on 14 Mar 2003 at 2:32 AM
: I'm getting this error of "a value of integral value type expected"
:
: I have two radiobuttonlist I'm trying to get values from. The values are strings so I"m lost as to the problem here. I'm thinking this must be an array and I need to use 0,1,2,3... instead of the actaul value I gave each list.
:
: heres the code:
:
: switch (purposes)
: {
: case "FClass":
: string purpose = FClass;
: switch(techpath)
: {
: case "Intel":
: string techpath = Intel;
: break;
: case "AMD":
: string techpath = AMD;
: break;
: case "DualIntel":
: string techpath = DualIntel;
: break;
: case "DualAMD":
: string techpath = DualAMD;
: break;
: case "Hidden":
: string techpath = Hidden;
: break;
: default:
: Response.Write("You must select a Tech Path");
: break;
: }
: break;
:
The compiler is referring to the integrity of your value in the switch statement
switch(techpath)
{
case "Intel":
string techpath = Intel;
break;

You are only assigning to the techpath inside the case
Ie techpath has no integrity in the switch cause it doesnt exist.

It seems like you trying to make things to complicated.

What is it that you have to do?


Report
Re: Newbie desprite for help with swtch statement Posted by JudyLooking on 14 Mar 2003 at 8:00 AM
Yes it appears as newbie I was making things pretty complicated. Did some reading and came up with one line of code that did the job int purpose = Convert.ToInt32(radioButtonListPurposes.SelectedItem.Value); go figure. But I'm running into a bigger problem which I'd like to make another post about, hoping to find answers maybe you can help me with this one.

I"m waisting a ton of time fixing the html tags. as soon as I make some changes the page gets messed up. The problem last night was crazy, there isn't a thing wrong with the tags yet it displays all over the page. Any ideas with that one?

Judy
thanks for the reply

: : I'm getting this error of "a value of integral value type expected"
: :
: : I have two radiobuttonlist I'm trying to get values from. The values are strings so I"m lost as to the problem here. I'm thinking this must be an array and I need to use 0,1,2,3... instead of the actaul value I gave each list.
: :
: : heres the code:
: :
: : switch (purposes)
: : {
: : case "FClass":
: : string purpose = FClass;
: : switch(techpath)
: : {
: : case "Intel":
: : string techpath = Intel;
: : break;
: : case "AMD":
: : string techpath = AMD;
: : break;
: : case "DualIntel":
: : string techpath = DualIntel;
: : break;
: : case "DualAMD":
: : string techpath = DualAMD;
: : break;
: : case "Hidden":
: : string techpath = Hidden;
: : break;
: : default:
: : Response.Write("You must select a Tech Path");
: : break;
: : }
: : break;
: :
: The compiler is referring to the integrity of your value in the switch statement
: switch(techpath)
: {
: case "Intel":
: string techpath = Intel;
: break;
:
: You are only assigning to the techpath inside the case
: Ie techpath has no integrity in the switch cause it doesnt exist.
:
: It seems like you trying to make things to complicated.
:
: What is it that you have to do?
:
:
:

Report
Re: Newbie desprite for help with swtch statement Posted by Brutes on 17 Mar 2003 at 2:39 AM
Tell me what are you using to update the Pages?
Where is it getting messed up? In the browser or in side your IDE?

I have learned from experience that it is better to just start over from scratch than to try and modify old pages.
The problem comes in with the runat=server property.
Ish you could even be missing something really silly like this property in the form tag itself.

DOTNET has changed a lot of things, Rather start the page from scratch and use the drag and drop environment till you are sure you know what is going on as to how things have changed.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.