Read From Database Into Excel

Posted on 2006-05-17
Medium Priority
Last Modified: 2012-06-27

What I need to do is this, I use a DataReader to get Information off the database and at that point I need to place this data into rows in an Excel Spreadsheet.

What I cannot do and do not understand is how I can

1. Create an Excel File in my folder,
2. Reference the Cells and Columns, so Cells(1,2), using C# in order to place the data where I need to.

Thanks in advance

Question by:REA_ANDREW
1 Comment
LVL 10

Accepted Solution

prakash_prk earned 2000 total points
ID: 16698519
You can use the Microsoft Excel Object library if your application is Windows.

microsoft not recommends excel object library to be used in ASP.NET. please try any third party controls like aspose


for using excel object library try the following link

If ujust want to write in try the CSV file format instead of XLS


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question