Alex Rivera | Logout

VB.NET equivalent to C# var keyword

Asked 2010-03-19T15:36:50.750
154

Is there a VB.NET equivalent to the C# var keyword?

I would like to use it to retrieve the result of a LINQ query.

Edit
Report

1 Answer

-1

Object worked for me in this example

C#

JToken projects = client.Search(ObjCode.PROJECT, new { groupID = userGroupID });
foreach( var j in projects["data"].Children()) {
        Debug.WriteLine("Name: {0}", j.Value<string>("name"));
}

VB

Dim projects As JToken = client.Search(ObjCode.PROJECT, New With { _
Key .groupID = userGroupID _
})

For Each j As Object In projects("data").Children()
       Debug.WriteLine("Name: {0}", j.Value(Of String)("name"))
Next
answered 2012-01-18T20:48:05.743

Your Answer