I want to know how to transform a DataTable into a Dictionary. I did something like this.
using System.Linq;
internal Dictionary GetDict(Da
ToDictionary is expecting the IEnumberable
as the first type... you were telling it that it was a string which is wrong it's IEnumerable
It's getting confused by you specifying the types... try this...
internal Dictionary GetDict(DataTable dt)
{
return dt.AsEnumerable()
.ToDictionary(row => row.Field(0),
row => row.Field