Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 i.e., with the buid in properties of C#. So is there any good solution for my problem?

like image 645
Nhuren Avatar asked Apr 17 '11 07:04

Nhuren


People also ask

How do I export data from DataGridView to excel?

Right click on your project and select Add Reference menu. After that go to COM tab and select and add Microsoft Excel 12.0 object library. Now here is my Button click event handler where I create Excel object and document, get data from DataGridView and add rows and columns to the document.


1 Answers

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

like image 56
ChrisWue Avatar answered Oct 12 '22 18:10

ChrisWue