Hi All,
I need to export data from sql server to excel sheet directly on an event. Any idea?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Jul 12, 2012, 5:22 AM EDT
http://www.c-sharpcorner.com/UploadFile/1a81c5/export-datatable-to-excel-with-formatting-in-C-Sharp/
Vijay YadavRank #1,637 · 943 reputationPosted Jul 23, 2012, 3:09 AM EDT
Thanks for your reply. I want to insert lac of data into one excel file. How to do that? I am just able to insert 65536 rows in a file, can we use another sheet for that I tried this as well but didn't workout for me. And its a window application. Any Idea?
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Jul 23, 2012, 3:12 AM EDT
So better change the xls to xlsx.
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=Reports.xls");
Change it to
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=Reports.xlsx");
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Jul 23, 2012, 3:14 AM EDT
http://royalarun.blogspot.in/2012/01/export-datatable-to-excel-in-c-windows.html
Vijay YadavRank #1,637 · 943 reputationPosted Jul 23, 2012, 3:27 AM EDT