tags:

views:

167

answers:

1

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

+7  A: 

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

myDataTable.WriteXml(filename);

It may not be as compact as you could desire, but it'll have the information you need...

Jon Skeet