Help. Exporting to Excel Workbook using ASP.NET,C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Friends.

I have three Datasets to be populated to one Excel Workbook. but i need to populate each datasets in to one worksheet. So if i export the datasets to one excel file, sheet1 should have Dataset1 and Sheet2 should have dataset2 and so on.

PLEASE HELP ME WITH THIS.
 
harish said:
I have three Datasets to be populated to one Excel Workbook. but i
need to populate each datasets in to one worksheet. So if i export
the datasets to one excel file, sheet1 should have Dataset1 and
Sheet2 should have dataset2 and so on.

Not knowing ASP.NET, I have to ask: does this process involve instantiating
an instance of the Excel Application class? If so, then you could create
three separate single worksheet workbooks to start, then move two of the
worksheets into the third workbook and save that final workbook. If not,
then you must have documentation that came with ASP.NET that explains what
you can do within its object model.
 
Harlan Grove said:
Not knowing ASP.NET, I have to ask: does this process involve instantiating
an instance of the Excel Application class?

I think the accepted wisdom when creating/updating Excel data from
ASP.NET is to use OleDb and the MS OLEDB provider for Jet. The syntax
is the same as for ADO 'classic' e.g. to update an existing Excel
table:

INSERT INTO
MyBookLevelName
(<<column list>>)
SELECT <<whatever>>

To create a new Excel table (creates the Excel table and if necessary
creates the worksheet and workbook as well):

SELECT
<<whatever>>
INTO
NewTable
FROM
<<wherever>>
;

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top