• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

ASP.NET - Feed QueryString varaibles into Array..to pass to a function..

I have this where data is being passed thru a query string...but I need an array to capture to pass that array to a function:


 Public Sub page_load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

'  www.sbccomp.com/custom_page.aspx?ID='123'&COLOR='blue'&MSG_1='x'&P_NUM_1='x'
'  &MSG_2='x'&P_NUM_2='x'&MSG_3='x'&P_NUM_='x'&MSG_4='x'&P_NUM_4='x'....

for every MSG_1='x'&P_NUM_1='x'
array.add = xxxx
Next

run_to_sql(array)
End function




dim var_ID_value as string
dim var_COLOR_value as string

var_ID_value  = Request.QueryString("ID")
var_COLOR_value  = Request.QueryString("COLOR")

' feed the varaibles into a sql piece that I already have...

...code..xxx...

end sub
0
GlobaLevel
Asked:
GlobaLevel
  • 2
1 Solution
 
GlobaLevelProgrammerAuthor Commented:
I FOUND IT IN c#..TYRING TO CONVERT TO VB.NET

      Dim loop1 As String, loop2 As String
        Dim arr2 As Array, arr1 As Array
        Dim my_array As Array
        Dim coll As NameValueCollection
        loop1 = 0
        loop2 = 0

        ' Load NameValueCollection object.
        coll = Request.QueryString
        'Get names of all keys into a string array.
        arr1 = coll.AllKeys
        ' for (loop1 = 0; loop1 < arr1.Length; loop1++)
           for loop1 TO arr1.Length
            Response.Write("Key: " + Server.HtmlEncode(arr1(loop1)) + "<br>")
            arr2 = coll.GetValues(arr1(loop1))
            'for (loop2 = 0; loop2 < arr2.Length; loop2++)
            for loop2 TO arr2.Length
                my_array.add("Value " + loop2 + ": " + Server.HtmlEncode(arr2(loop2) + "<br>"))
            Next
        Next
0
 
GlobaLevelProgrammerAuthor Commented:
ANY HELP?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now