I'm trying create a excel file based in a Dataset.
C# Save Excel File
How to save DataSet into Excel files. C# / C Sharp Forums. Is that any other way to save the Dataset into Excel. Excel and.dbf output file from DataSet using.
This is my really simple code.
Export a DataTable to an Excel file and add format to the contents while writing the. Saving DataSet or DataTable instace to an Excel spreadsheet with C#. Hi, Using C#, which is the best and easiest way to export all the data from a..com/Reference/753207/Export-DataSet-into-Excel-using-Csharp-Excel-Inter. OutputStream);//or easy_WriteXLSXFile for xlsx file workbook.
but my excel file result in this:
I have to pass to Export a iqueryble. I think is there my mistake.
C# Save Datatable To Excel
1 Answer
You're seeing the actual properties defined in DataRow
, not the columns of your table.
You need to change your Export()
method to check for & consume IListProvider
to get custom PropertyDescriptor
s for the columns, or use classes with actual properties (eg, an anonymous type) instead of DataTable
.