hi all,
i need to create a excel and load it from database(datatable,dataset). how to do it
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
Vasu GadhiyaRank #7,540 · 239 reputationPosted Apr 23, 2014, 3:06 AM EDT
prathaban durai22 reputationPosted Apr 23, 2014, 3:08 AM EDT
Abhay ShankerRank #375 · 6.7K reputationPosted Apr 23, 2014, 3:36 AM EDT
http://www.c-sharpcorner.com/UploadFile/83fe73/solutions-to-export-data-from-database-to-excel-in-C-Sharp/
Vasu GadhiyaRank #7,540 · 239 reputationPosted Apr 23, 2014, 4:12 AM EDT
http://www.c-sharpcorner.com/UploadFile/ae35ca/read-and-write-excel-data-using-C-Sharp/
Rahul PrasadRank #2,557 · 546 reputationPosted May 8, 2014, 5:49 PM EDT
http://www.e-iceblue.com/Knowledgebase/Spire.DataExport/Program-Guide/How-to-Export-Datatable-to-Excel-through-DataGridView.html, it demonstrates how to programmatically create an excel file from datatable with a sample.
kind regards
Glen Lewis14 reputationPosted Jul 8, 2014, 4:35 AM EDT
// Create new file. ExcelFile file = new ExcelFile(); // Iterate through all DataTables. foreach (DataTable dataTable in dataSet.Tables) { // Create new sheet. var sheet = file.Worksheets.Add(dataTable.TableName); // Insert DB data. sheet.InsertDataTable(dataTable, new InsertDataTableOptions("A1") { ColumnHeaders = true }); } // Save file. file.Save("DataSet.xlsx");