c# - Convert DataRow to Dictionary using LINQ -


i need convert datarow dictionary using linq.

the code below datarow, next step need convert dictionary(columnname, rowvale)

var workweekdata = data in mworkweekdata.asenumerable ()             data.field<string> ("code") == code             select data; 

it's possible, yes:

var dict = row.table.columns               .cast<datacolumn>()               .todictionary(c => c.columnname, c => row[c]); 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -