Sandhurst
Sandhurst

Reputation:

Export To Excel Fom DataGrid VB.Net Windows Application

I need to Export DataGrids' Contents to Excel using VB.Net for a Window based Application.

How to do this.. any ideas ?

Upvotes: 0

Views: 1770

Answers (2)

Ender
Ender

Reputation: 213

Out of the box DataGrid doesn't support this feature. You can a. Use a third party data grid that has this feature b. Create a report that have the same contents as the grid. Report Viewer control that is freely available from Microsoft has the feature to export to Excel

Upvotes: 0

danish
danish

Reputation: 5600

The are plenty of ways to do this. Create the excel file using static methods in the File class. Then you can create a OleDB connection to the excel file and then write all the data to it using SQL query.

Upvotes: 1

Related Questions