Dump C # DataTable to file

Is there a quick and dirty way to dump the contents of a System.Data.DataTable file into a text file or some "thing" for debugging purposes?

+6
c # datatable
source share
1 answer

DataTable.WriteXml(string) will write it to a file ...

 myDataTable.WriteXml(filename); 

It may not be as compact as you might wish, but it will have the necessary information ...

+14
source share

All Articles