dividing values retrieved from a Request.Form

son

Regular
Joined
Feb 21, 2004
Messages
67
hi hope all is well..

i have an aspx.vb page which is calling values from an aspx page as follows

Visual Basic:
 strMobileList = Request.Form("Mobiles:selectedMobileList")

the strMobilelist is getting values from the form which are 1,20,50218. These values are all primary keys from a table

can someone tell me how i can make this list of values each separately in a variable for example var a = 1, var b = 20 , var c = 50218 to be able to use either one of them in an sql statement with code in my aspx.vb file

thanks sonia...
 
son said:
hi hope all is well..

i have an aspx.vb page which is calling values from an aspx page as follows

Visual Basic:
 strMobileList = Request.Form("Mobiles:selectedMobileList")

the strMobilelist is getting values from the form which are 1,20,50218. These values are all primary keys from a table

can someone tell me how i can make this list of values each separately in a variable for example var a = 1, var b = 20 , var c = 50218 to be able to use either one of them in an sql statement with code in my aspx.vb file

thanks sonia...

Is it what you want?

Visual Basic:
Dim arr() as string = split(strMobileList,",")
Dim a as string = arr(0)
Dim b as string = arr(1)
Dim c as string = arr(2)
 
dynamic array

hi thanks for the tip...
can u tell me what can i do if i want the array to be dynamic, because it will not always bring all values. it might bring back more or less..

once again thanks loads and i really appreciate it ... spent all nite on this problem and couldnt solve it... ;)
 
son said:
hi thanks for the tip...
can u tell me what can i do if i want the array to be dynamic, because it will not always bring all values. it might bring back more or less..

once again thanks loads and i really appreciate it ... spent all nite on this problem and couldnt solve it... ;)

Visual Basic:
Dim arr() as string = split(strMobileList,",")
Dim I as Integer

For I = 0 to UBound(arr)
   ...
Next I
 
CAN dimensional array in ascending or descending order

heya is there any syntax for the array to be in descending or ascending order for example like
Visual Basic:
dim arr() as string = split(strMobileList,",")
dim i as integer
dim a as string

for i = 0 to ubound(arr)
a = arr(i)
next i

thanks in advance ... :)
 
hi thanks for ur reply and i apologise if i didnt explain myself clearly.. i wish u can help me, i spent all nite with this problem and still have got no outcome its tiring me big time...

strMobileList is getting values from a form. The values are 20,1,50218. these values are id's as i mentioned earlier of a table which are representing mobile id. The array below is getting the values and 20, 1 , 50218.

My problem is that i need to pass each array element to a navigate.url.link but in ascending order meaning that the array will pass first 1 then do something with it , then 20 and do something with it then 50218 instead of themixing up order of the valuesup . also the array has to be dynamic because strmobilelist will not always bring back the same values since it is getting it values from a form when the user selects the values from a listbox on the form

this is the code you told me about and its fine , i just need the array to pass it first element in ascending order from small to big

Visual Basic:
dim arr() as string = split(strMobileList,",")
dim i as integer
dim a as string

for i = 0 to ubound(arr) ASC
a = arr(i)
next i

once again thanks and i hope i explained myself better this time.. :)
 
Back
Top