|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
passing multiple values
<i><b>Originally posted by : bonner (bonner1975@yahoo.com)</b></i><br />I have a dropdown list that a user can select multiple values from. I want to pass this information to a Store Procedure in SQL and get back a result set. How would I go about doing it? Thanks for any help you can give.
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : steve</b></i><br />once you select all the values inside the multiple list box, this is a comma-delimited valueset. you'd have to loop through to parse tha values.<br /><br /><br />------------<br />bonner at 4/24/2002 2:50:54 PM<br /><br />I have a dropdown list that a user can select multiple values from. I want to pass this information to a Store Procedure in SQL and get back a result set. How would I go about doing it? Thanks for any help you can give.
|
|
#3
|
|||
|
|||
|
<i><b>Originally posted by : bonner (bonner1975@yahoo.com)</b></i><br />Thanks. I did parse out the values. See the code below. What's happening now is that it is returning only the result set of the last value. I must be doing something wrong. Any help you can give would be great.<br /><br /><%newparam = request("paramname")<br /> start = 1<br /> LastComma=Instr(start,newparam,",",vbTextCompare)<br />%><br /><br /> <% If ( LastComma > 0 ) Then %> <br /> <%While ( LastComma > 0 )%><br /> <%tempstr = Mid(newparam,start,LastComma-start)%><br /> <%=tempstr%><BR> <br /> <%<br /> start = LastComma+2 <br /> LastComma = Instr(start,newparam,",",vbTextCompare)<br /> tempstr = ""<br /> %> <br /> <%Wend%> <br /><br /> <%tempstr = Right(newparam,len(newparam)-start+1)%> <br /> <%=tempstr%> <br /> <%Else%> <br /> <%tempstr = newparam%> <br /> <%=tempstr%><br /> <%End IF%><br />------------<br />steve at 4/30/2002 9:08:38 PM<br /><br />once you select all the values inside the multiple list box, this is a comma-delimited valueset. you'd have to loop through to parse tha values.<br /><br /><br />------------<br />bonner at 4/24/2002 2:50:54 PM<br /><br />I have a dropdown list that a user can select multiple values from. I want to pass this information to a Store Procedure in SQL and get back a result set. How would I go about doing it? Thanks for any help you can give.
|
|
#4
|
|||
|
|||
|
<i><b>Originally posted by : aztec (aztec@wanadoo)</b></i><br />Could you explain a little further:<br />-> what does your sproc do with the values? (or what should it do?)<br />-> could you show us some code of your sproc?<br /><br />If you mean that the response.writes you do here are returning only one result, that's because you place them outside your loop so they'll only show the last value.<br /><br />------------<br />bonner at 5/1/2002 11:41:00 AM<br /><br />Thanks. I did parse out the values. See the code below. What's happening now is that it is returning only the result set of the last value. I must be doing something wrong. Any help you can give would be great.<br /><br /><%newparam = request("paramname")<br /> start = 1<br /> LastComma=Instr(start,newparam,",",vbTextCompare)<br />%><br /><br /> <% If ( LastComma > 0 ) Then %> <br /> <%While ( LastComma > 0 )%><br /> <%tempstr = Mid(newparam,start,LastComma-start)%><br /> <%=tempstr%><BR> <br /> <%<br /> start = LastComma+2 <br /> LastComma = Instr(start,newparam,",",vbTextCompare)<br /> tempstr = ""<br /> %> <br /> <%Wend%> <br /><br /> <%tempstr = Right(newparam,len(newparam)-start+1)%> <br /> <%=tempstr%> <br /> <%Else%> <br /> <%tempstr = newparam%> <br /> <%=tempstr%><br /> <%End IF%><br />------------<br />steve at 4/30/2002 9:08:38 PM<br /><br />once you select all the values inside the multiple list box, this is a comma-delimited valueset. you'd have to loop through to parse tha values.<br /><br /><br />------------<br />bonner at 4/24/2002 2:50:54 PM<br /><br />I have a dropdown list that a user can select multiple values from. I want to pass this information to a Store Procedure in SQL and get back a result set. How would I go about doing it? Thanks for any help you can give.
|
|
#5
|
|||
|
|||
|
<i><b>Originally posted by : Bonner (bonner1975@yahoo.com)</b></i><br />Based off of what the user selects from the dropdown list, the information gets passed to the following:<br /><br />@newparam varchar(3)<br />Select * From Employee Where center IN @newparam<br /><br />------------<br />aztec at 5/10/2002 4:00:40 PM<br /><br />Could you explain a little further:<br />-> what does your sproc do with the values? (or what should it do?)<br />-> could you show us some code of your sproc?<br /><br />If you mean that the response.writes you do here are returning only one result, that's because you place them outside your loop so they'll only show the last value.<br /><br />------------<br />bonner at 5/1/2002 11:41:00 AM<br /><br />Thanks. I did parse out the values. See the code below. What's happening now is that it is returning only the result set of the last value. I must be doing something wrong. Any help you can give would be great.<br /><br /><%newparam = request("paramname")<br /> start = 1<br /> LastComma=Instr(start,newparam,",",vbTextCompare)<br />%><br /><br /> <% If ( LastComma > 0 ) Then %> <br /> <%While ( LastComma > 0 )%><br /> <%tempstr = Mid(newparam,start,LastComma-start)%><br /> <%=tempstr%><BR> <br /> <%<br /> start = LastComma+2 <br /> LastComma = Instr(start,newparam,",",vbTextCompare)<br /> tempstr = ""<br /> %> <br /> <%Wend%> <br /><br /> <%tempstr = Right(newparam,len(newparam)-start+1)%> <br /> <%=tempstr%> <br /> <%Else%> <br /> <%tempstr = newparam%> <br /> <%=tempstr%><br /> <%End IF%><br />------------<br />steve at 4/30/2002 9:08:38 PM<br /><br />once you select all the values inside the multiple list box, this is a comma-delimited valueset. you'd have to loop through to parse tha values.<br /><br /><br />------------<br />bonner at 4/24/2002 2:50:54 PM<br /><br />I have a dropdown list that a user can select multiple values from. I want to pass this information to a Store Procedure in SQL and get back a result set. How would I go about doing it? Thanks for any help you can give.
|
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > passing multiple values |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|