Download datatable into excel format using c#
hello! i have accessed the datatable from server and now i want that user may download it in excel form please help me for coding
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
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Oct 3, 2013, 4:24 AM EDT
Refer to this link it may help you
http://www.c-sharpcorner.com/UploadFile/1a81c5/export-datatable-to-excel-with-formatting-in-C-Sharp/
Sunny SharmaRank #223 · 11.1K reputationPosted Oct 3, 2013, 4:29 AM EDT
Use the code below:
----------------------------------
-----------------------------------------------------
I've also attached a compiled DLL of the same code to make you go with ease.
Just refer the DLL file in your project and call it like:
DtToExcel.GetInExcel(mydataTable,myFileName);
-----------------------------------------------------
Hope it helps :)