Search code examples
c#oledb

How can I see a full view of a datatable?


So I have read in a .xls file into a data table. Created a new table with a schema that matches a database table. Then iterate through each row/column and assign the correct data to the fields of the new data-table.

The last piece is passing the data-table as a parameter to a stored proc to process to a temp table which will then get merged with the actual table in the database.

My question is (for testing purposes) how can I easily write out (or view) the contents of new data-table to verify its contents and structure before I proceed to pass onto the Stored proc?

thanks,


Solution

  • You can use the WriteXml method.