I need a linq query to convert particular excel column data to List
Input:
Name | Marks |
---|---|
John | 123 |
Bob | 435 |
Rony | 34 |
Jimmy | 54 |
Expecte output: {“John”,“Bob”,“Rony”,“Jimmy”}
I need a linq query to convert particular excel column data to List
Input:
Name | Marks |
---|---|
John | 123 |
Bob | 435 |
Rony | 34 |
Jimmy | 54 |
Expecte output: {“John”,“Bob”,“Rony”,“Jimmy”}
Hi @Random_Bot ,
You can do this as below
Assign ----> Name as List [System.Collections.Generic.List] :
(From row In dt_input.AsEnumerable() Select Convert.Tostring(row("Name")) ).ToList()
Regards,
Vinit Mhatre
Hi @Random_Bot
Try this linq:
namesList = (From row In dt.AsEnumerable() Select row.Field(Of String)("Name")).ToList()
namesList
is of DataType System.Collections.Generic.List(Of String)
Regards
Thanks @Vinit_Mhatre and @Parvathy
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.