|
-
Mar 2nd, 2006, 08:28 AM
#1
Thread Starter
Frenzied Member
Select Case error
Can someone please tell me why I get an error ??
Select Case check
Case "1"
DDdisability1.SelectedValue = "Please Select"
DDdisability1.SelectedValue = Nothing
Case "2"
DDdisability2.SelectedValue = "Please Select"
DDdisability2.SelectedValue = Nothing
.......................................etc
Case "10"
DDdisability10.SelectedValue = "Please Select"
DDdisability10.SelectedValue = Nothing
End Select
Last edited by angelica; Mar 2nd, 2006 at 05:48 PM.
-
Mar 2nd, 2006, 08:35 AM
#2
Re: Select Case error
What kind of error are you getting. You will need to provide more information. Which line does it show error on?
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Mar 2nd, 2006, 09:15 AM
#3
Re: Select Case error
1. DDdisability1.SelectedValue.ToString = "Please Select"
DDdisability1.SelectedValue = Nothing
Remove the 'ToString'
2. Why set the selectedvalue to nothing after setting the selectedvalue to 'please select'?
3. Could it be the **** ?
-
Mar 2nd, 2006, 05:46 PM
#4
Thread Starter
Frenzied Member
Re: Select Case error
hi,
What Im trying to do is this:
these 10 dropdownlists are populated by a field. The first record to show is "Please select". Now if the user does not need to have information from all dropdownlist then the field is left empty.
My error is on the name of the Select Case Check saying
name is not declared.
If there is a better way to check all 10 dropdowns please tell me, or else please tell me where is my mistake.
Many many thanks
-
Mar 2nd, 2006, 05:49 PM
#5
Re: Select Case error
What is sAccessID ID?
I think this has not been declared anywhere!
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Mar 2nd, 2006, 05:52 PM
#6
Re: Select Case error
Place a break point on the SELECT line and then when the system breaks there, start pointing your cursor at variable names. One will come up undefined. It is the offender.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Mar 2nd, 2006, 05:55 PM
#7
Re: Select Case error
 Originally Posted by Lord_Rat
Place a break point on the SELECT line and then when the system breaks there, start pointing your cursor at variable names. One will come up undefined. It is the offender.
It will not compile first of all with this kind of error. So there is no case of debugging it.
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Mar 2nd, 2006, 06:00 PM
#8
Re: Select Case error
Well for sake of what she is trying to do, this might be a good place to start:
(This is the C# version, it needs to be adapted to VB and I am not quite up on my VB enough to do it)
Code:
int iCheckID = /*Fill the ID with the number some how*/;
System.Web.UI.WebControls.DropDownList oDDL = (System.Web.UI.WebControls.DropDownList)Page.FindControl("DDdisability" + i.ToString());
oDDL.SelectedIndex = 0; //Where the first item in the list is "Please Select"
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Mar 3rd, 2006, 03:07 AM
#9
Thread Starter
Frenzied Member
Re: Select Case error
hi,
Someone give me a version of VB.NET please cos I need it badly. Urgent if anyone can help. 10 xx
-
Mar 3rd, 2006, 08:48 AM
#10
Re: Select Case error
There's a nice fast online convertor here
and it gives this output.
VB Code:
Dim iCheckID As Integer = 2 'A number i entered to make conversation work.
Dim oDDL As System.Web.UI.WebControls.DropDownList = CType(Page.FindControl("DDdisability" + i.ToString), System.Web.UI.WebControls.DropDownList)
oDDL.SelectedIndex = 0
-
Mar 3rd, 2006, 04:28 PM
#11
Thread Starter
Frenzied Member
Re: Select Case error
hi,
But how am I gona loop through all 10 DDdisability ....Selectedvalue = "Please Select ?? Im no expert on programming!!
-
Mar 4th, 2006, 06:17 PM
#12
Re: Select Case error
Alright, and?
Can't you modify fishcake's code? Where exactly are you confused? What is your question?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|