Read From Database Into Excel

Posted on 2006-05-17
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

    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

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now