c# - How to convert DataRow[] to List<string[]> -


i have

datatable dt; datarow[] drarray = dt.select().toarray(); 

my requirement want convert drarray list<string[]> or converting datatable list<string[]> in fastest way.

i think want:

list<string[]> results =     dt.select()         .select(dr =>             dr.itemarray                 .select(x => x.tostring())                 .toarray())         .tolist(); 

this works if items stored in dr.itemarray have overriden .tostring() in meaningful way. luckily primitive types do.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -