I am trying to create a multidimensional array and am recieving a
I am trying to create a multidimensional array and am recieving an error
Object reference not set to an instance of an object. Is my array setup correctly? If I don't use an array I don't recieve errors and all my data prints out on response.writes.
Dim i as integer = -1
Dim row As DataRow
Dim k As Integer = 0
Dim thelist as string
Dim thepropID as String
Dim oldstate as string = " "
Dim proparray( , ) as string
Dim strVDS as string
Dim arraybounds as integer
Dim rowscount as integer = empDS.Tables("properties"
.Rows.count
For Each row In empDS.Tables("properties"
.Rows
If empDS.Tables("properties"
.Rows(k).Item("propName"
<> oldstate Then
i = i + 1
oldstate = empDS.Tables("properties"
.Rows(k).Item("state"
End if
proparray(i,0) = empDS.Tables("properties"
.Rows(k).Item("state"
proparray(i,1) = empDS.Tables("properties"
.Rows(k).Item("propName"
+ "|" + empDS.Tables("properties"
.Rows(k).Item("propName"
proparray(i,2) = empDS.Tables("properties"
.Rows(k).Item("xscale"
+ "|" + empDS.Tables("properties"
.Rows(k).Item("xscale"
proparray(i,3) = empDS.Tables("properties"
.Rows(k).Item("yscale"
+ "|" + empDS.Tables("properties"
.Rows(k).Item("yscale"
proparray(i,4) = empDS.Tables("properties"
.Rows(k).Item("propID"
+ "|" + empDS.Tables("properties"
.Rows(k).Item("propID"
k = k + 1
Next
I am trying to create a multidimensional array and am recieving an error
Object reference not set to an instance of an object. Is my array setup correctly? If I don't use an array I don't recieve errors and all my data prints out on response.writes.
Dim i as integer = -1
Dim row As DataRow
Dim k As Integer = 0
Dim thelist as string
Dim thepropID as String
Dim oldstate as string = " "
Dim proparray( , ) as string
Dim strVDS as string
Dim arraybounds as integer
Dim rowscount as integer = empDS.Tables("properties"
For Each row In empDS.Tables("properties"
If empDS.Tables("properties"
i = i + 1
oldstate = empDS.Tables("properties"
End if
proparray(i,0) = empDS.Tables("properties"
proparray(i,1) = empDS.Tables("properties"
proparray(i,2) = empDS.Tables("properties"
proparray(i,3) = empDS.Tables("properties"
proparray(i,4) = empDS.Tables("properties"
k = k + 1
Next