I have a list of Tuples
I am trying to run a Select
and Where
query on to return a list of Objects
from the Tuple.Item5
parameter. In my where clause I am looking to match Tuple.Item4
to a local variable.
I'm not sure what the VB.NET syntax is for the Select portion, I only know the c# syntax.
Essentially I am trying to select Tuple.Item5
from my list of tuples where Tuple.Item4 = sCurID. I'm unsure as to what should go in the Select section although in c# I believe it would be Select(t => t.Item5)
This is what I have:
listObj = listTuples.Select( Unsure What Goes Here ).Where(Function(w) w.Item4 = sCurID)
LINQ query syntax always ends with a Select or Group clause. The Select clause is used to shape the data. You can select the whole object as it is or only some properties of it. In the above example, we selected the each resulted string elements.
Most queries in the introductory Language Integrated Query (LINQ) documentation are written by using the LINQ declarative query syntax.
Based on the generated module you can now use the classes "clsCCSQL" and "clsCCSQL_Condition" to get a kind of "LINQ" in VBA. After importing these two classes into the own database and after generating the module and import it like described above you should be able to compile your code without error message.
Select query in LINQ Select method is used to select one or more items from collection or list object, here we see some example of linq select statement. variableName. Select(s => s.Name); There are various ways we can select some records or single record from a collection object.
Once you apply the Select
in C# or VB, you have reduced the Tuple to the Item5
value and can't access Item4
. Do the Select
last:
Dim listObj = listTuples.Where(Function(t) t.Item4 = sCurId).Select(Function(t) t.Item5)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With