Building a multidimensional array in vb.net

前端 未结 5 1886
离开以前
离开以前 2020-12-10 05:30

I\'m trying to build up a multidimensional array which will hold two bits of info for each record in a database e.g. id, description.

This is what I am currently doi

5条回答
  •  粉色の甜心
    2020-12-10 05:41

    Try this

    Dim mArray(1,1) As String
    Dim i As Integer = 0
    While cmdReader.Read()
        mArray(i,0) = cmdReader.Item("id")
        mArray(i,1) = cmdReader.Item("description")
        i = i + 1
        ReDim Preserve mArray(i,1)
    End While
    

提交回复
热议问题