Export Datagridview records to Excel

Hey friends i need to export records of datagridview of winform to MSExcel. I want to do it without using any DLL ie, with the buid in properties of C#. So is there any good solution for my problem?


Export the data as CSV file. Excel can read those fine.


A common way to do this would be through MSOffice PIAs. Is that what you'd like to avoid?


You can read the values from data grid using reflection or you can take your data model which is bound to the data grid and create a csv file. The csv file can be read by MS Excel.

链接地址: http://www.djcxy.com/p/6262.html

上一篇: 如何正确使用有状态的Python模块实现测试隔离?

下一篇: 将Datagridview记录导出到Excel