Hello i have been trying to convert a datatable into dictionary using this code:
(From d In dt.AsEnumerable
Let kvp = New KeyValuePair(Of string, string)(d(1).toString,d(2).toString)
Select kvp).ToDictionary(of string, string)Function (x) x.Key, Function (x) x.Value)
My question is what if i need to define multiple kvps based on a specific column of the dt, example
mydt would be like this
Category:KeyColumn:ValueAColumn:ValueBColumn
Cat1:Key1:A:a
Cat2:Key2:B:b
my dictionary should look like this
{Key1,A},
{Key2,b}
Appreciate your help guys.
Thanks