0

My problem is as follows:
I'm making a ranking board for my team. I've managed to get the data out of the database and I put it into a two-dimensional array. I sent it as model data to the view.
Now I don't know how to loop through the two-dimensional array.

Normally it would be something like this:

For Each record in Model
...
Next

How do you loop through two dimensions?

Thanks in advance.

1 Answer 1

2

Couldn't you just use two loops?

  For i = 0 To Model.ArrayProperty.GetUpperBound(0)
     For j = 0 To Model.ArrayProperty(i).GetUpperBound(0)
        doWhatever( Model.ArrayProperty(i)(j) )
     Next
  Next
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, I never thought it was that easy. Quick response btw ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.