Reputation: 513
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?
Upvotes: 7
Views: 1236
Reputation: 434
I followed this video tutorial, in 10min you can do it, you must use the System.Data.SqlClient reference, make a method, and override, the code for the button, and put the gridview in a form tag, here is the link export from datagridview to excel
Upvotes: 0
Reputation: 1080
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.
Upvotes: 0
Reputation: 8007
A common way to do this would be through MSOffice PIAs. Is that what you'd like to avoid?
Upvotes: 0