When writing some tests for the project I'm working on, I found that the best way for me to get the data back that I need about whether the project was correct is to put the results in an ADO.NET DataTable. I was tired of setting breakpoints and expected them to hit so I could use the DataSet sample document to find out what my results were and I wanted to see the results after the test was completed, so I decided to find a quick and dirty way to write the DataTable to a file .
After you looked into Intellisense to try to find a good way to get my DataTable into a file, I searched googled a bit and found someone who wrote code to write a DataTable to a table in an html file. I spent a few minutes and realized my own version of this and went with my own fun. I like the html solution because it was very easy to implement, it is fully portable, and it’s easy to refresh the page and see the latest test results after making changes to my code.
At this point, I wonder, however, did I miss the easier / better way to do this? Keep in mind that the requirements should be able to render the table in real tabular form, and not be serialized as XML or any other less readable format, and it should be in a file on the hard drive so I can get back to it. Any ideas?
source
share