Export DataTable to Excel File

0 votes
I have a DataTable with 30+ columns and 6500+ rows.I need to dump the whole DataTable values into an Excel file.Can anyone please help with the C# code.I need each column value to be in a cell.To be precise,I need the exact looking copy of DataTable in an Excel File.Please help.

Thanks, Vix
Jun 8 in JQuery by Edureka
• 13,640 points
5 views

1 answer to this question.

0 votes

  1. Add Interop References. First we need to add a reference for Microsoft.office.interop.Excel as in the following:
  2. Create a DataTable dynamically.
  3. Class file for generating Excel. ...
  4. Creation of Excel objects. ...
  5. Initialization of Excel objects. ...
  6. Writing to Excel file. ...
  7. Working with range and formatting Excel cells. ...
  8. Coloring cells.
answered Jun 9 by gaurav
• 12,980 points

Related Questions In JQuery

0 votes
1 answer

Datatables export Excel

Follow the following steps : Add Interop References. ...READ MORE

answered Jun 9 in JQuery by gaurav
• 12,980 points
7 views
0 votes
1 answer

Error: cannot call methods on dialog prior to initialization; attempted to call method 'close'

Hello @kartik, Looks like your buttons are not ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,720 points
3,981 views
0 votes
1 answer

How to import jQuery UI using ES6/ES7 syntax?

Hii, Add a alias in webpack config: resolve: { ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,720 points
5,020 views
0 votes
1 answer

How to convert form data to JavaScript object with jQuery?

Hello @kartik, You can use: function form_to_json (selector) { ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,720 points
1,441 views
0 votes
1 answer

Authenticate on an ASP.Net Forms Authorization website from a console app

Essentially, we need to record a regular ...READ MORE

answered Sep 20, 2018 in IoT (Internet of Things) by Annie97
• 2,160 points
247 views
0 votes
1 answer

Writing SEO friendly url gets infinite loop asp.net

you should know that regex avoid cases ...READ MORE

answered Feb 11 in Others by narikkadan
• 10,840 points
138 views
0 votes
1 answer

Deleting duplicate rows in Excel using Epplus

You need to re-think this… the while ...READ MORE

answered Feb 23 in Database by gaurav
• 12,980 points
67 views
0 votes
0 answers

How to get Bitcoin value for corresponding USD value in ASP.NET C#?

I want to get the Bitcoin value ...READ MORE

Mar 1 in Blockchain by Soham
• 8,730 points
93 views
0 votes
1 answer

How to upload excel file to php server from <input type="file">

You first need to upload the file ...READ MORE

answered Jun 9 in JQuery by gaurav
• 12,980 points
17 views
0 votes
1 answer

How to turn off Auto Refresh on "Stock Price" Data Type in Excel

How do you stop Excel from automatically ...READ MORE

answered Jun 9 in JQuery by gaurav
• 12,980 points
5 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP