How to export excel in on button click

Recommended Answers

All 3 Replies

You will need to elaborate. What do you mean export excel? Do you have a table of info you want saved to excel?

Need to export data from database to Excel? or Excel to Database?

If the former, I think this article may give you some suggestions.

If the later, I want to introduce my solution with a commercial Excel library to export data from Excel sheet to datatable.

            //Load workbook
            Workbook workbook = new Workbook();
            workbook.LoadFromFile(Server.MapPath("./test.xls"), ExcelVersion.Version97to2003);
            //Export data to datatable
            DataTable dt = workbook.Worksheets[0].ExportDataTable();

Please Reply fast it's urgent..
How to export data from database to Excel in

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.