Does anyone have an example on how to export a DataGridView to an excel spreadsheet?
The DataGridView is bound to a dataset.
Thanks.
Does anyone have an example on how to export a DataGridView to an excel spreadsheet?
The DataGridView is bound to a dataset.
Thanks.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mike GoldPosted Oct 12, 2007, 5:57 PM
There are two ways.
You can try binding directly to Excel through OleDb:
http://www.spreadsheetgear.com/support/samples/datagrid.aspx
http://support.microsoft.com/kb/306572
or you can use InterOp to populate Excel:
http://www.c-sharpcorner.com/UploadFile/mgold/Query2Excel12032005011029AM/Query2Excel.aspx
Best,