Click here to Skip to main content
15,905,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created an application in which I have used data gridview.

Now I want to save this DataGridView's data into an excel sheet by clicking on Button
How to do this? can u help me?
Posted
Updated 13-Sep-11 19:50pm
v2

Go through this article[^].
 
Share this answer
 
Comments
Simon Bang Terkildsen 14-Sep-11 1:58am    
While using office interop is a possibility it's a bad idea, it's not supported, full of bugs and and the code is not easy to read later on.
A 4 from me, I still believe a library is a better option ven if it just wraps office interop.
try to use this free dll
Export to Excel
 
Share this answer
 
v2
 
Share this answer
 
You can do that with a 3rd party library or using office interop, I suggest you go for a 3rd party library.

A quick google search yielded http://www.libxl.com/[^] amongst others
 
Share this answer
 
Comments
kami124 14-Sep-11 1:33am    
what do u mean by 3rd party library
i create it using text.csv
but the problem over there is header filed is not saved
how to save the header
Simon Bang Terkildsen 14-Sep-11 2:05am    
by 3rd party library I mean a library, a set of one or more dlls, which you get from another source, that can be an open source project or something you buy.

i create it using text.csv
So you have actually saved your data, really? I don't see that in your question would have been a good idea to include. So we could answer your actual question instead of the one you posted.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900