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

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

javascript - Create websocket without connecting -

sharepoint - Accessing files across a shared directory using a Windows service -