Extract data from an Array
I have an array DetailsArray in VB.NET which contains the result of a LINQ query. I have shown below the values of the array. i need to get the "ProjectID" from the array and assign开发者_JS百科 it to 'ProjID' variable
DetailsArray (0){Name = "TestProject1", ProjectID = 10}
Dim ProjID as Integer = DetailsArray(??)
How would I do that?
Thanks in advance.
You are showing the values of the first element of the array (DetailsArray(0)
), not of the whole array (DetailsArray
).
To get to the value of the ProjectID
property in the first element of the array:
Dim ProjID as Integer = DetailsArray(0).ProjectID
精彩评论