开发者

Extract data from an Array

开发者 https://www.devze.com 2022-12-26 14:37 出处:网络
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

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
0

精彩评论

暂无评论...
验证码 换一张
取 消