Hello,
I am trying to store the results of a list into an array, but for some reason the array is only storing one value, rather than the full set of values. The code I am using is shown below. Could someone please tell me where I am going wrong?
Dim find_postcode() As String
Dim resultsList As New List(Of String)
For Each dr As DataRow In ds2.Tables(0).Rows
resultsList.Add(dr("PostCode").ToString)
Next
For Each s As String In resultsList
find_postcode(5000000) = (s)
Next
Response.Write(find_postcode(5000000))
I am trying to store the results of a list into an array, but for some reason the array is only storing one value, rather than the full set of values. The code I am using is shown below. Could someone please tell me where I am going wrong?
Dim find_postcode() As String
Dim resultsList As New List(Of String)
For Each dr As DataRow In ds2.Tables(0).Rows
resultsList.Add(dr("PostCode").ToString)
Next
For Each s As String In resultsList
find_postcode(5000000) = (s)
Next
Response.Write(find_postcode(5000000))