Hi Everyone,

Ive come across the need for a Multidimensional dynamic Array however its causing a headache so can anyone shed any light on the matter...

VB Code:
  1. Dim CusArray(,)
  2.                 Dim i, j As Integer
  3.                 i = 0
  4.                 j = 0
  5.  
  6.                 While MyReader.Read
  7.                     CusArray(i, 0) = "1" 'MyReader("CustomerId")
  8.                     CusArray(i, 1) = "Carl Blanchard" 'MyReader("FullName")
  9.                 End While
  10.                 ReDim Preserve CusArray(LBound(CusArray), UBound(CusArray))
  11.  
  12.                 MsgBox(CusArray(0, 0))

I get this error saying "Object reference not set to the instance of the object" which is caused my CusArray(i, 0) = "1" 'MyReader("CustomerId") However if i try and Dim CusArray(,) as New Array it dosnt allow me just says Arrays cant not be declared with New- ive read loads of posts on here but none help, most of them are vb6 and not .net,


I will know the size of the size of the subscript which will be max of 11 however this array is made up from records out of my db so i will not know the size of the Index......


Can any one help, code examples would be good

thanks Carl