tags:

views:

37

answers:

1

Hello,

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 it to 'ProjID' variable

DetailsArray (0){Name = "TestProject1", ProjectID = 10}

 Dim ProjID as Integer = DetailsArray(??)

How would I do that?

Thanks in advance.

+1  A: 

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
Oded
Great thanks. Thats the whole array, It only has those elements.
fireBand