Export from VB.NET 2003 to an Excel spreadsheet

S

Scott M. Lyon

I'm trying to figure out a way to export data (actually the result of a
Stored Procedure call from SQL Server) into a specified Excel spreadsheet
format.


Currently, I have the data read into a DataSet that consists of one
DataTable.

That DataTable has a specific name (for arguments purposes, let's say it's
called "DataGrid"), that I need to use as the tab name in the exported Excel
spreadsheet.

That DataTable has specific column names, which I want to use as the first
row on that worksheet (of the exported Excel). I then want to use the
remaining rows to populate the rest of the cells in the spreadsheet.


Is there an easy way to do this?


I am currently using an OleDBAdapter object to read from an Excel
spreadsheet (something that would also apply to this newly-exported Excel
spreadsheet), and using it's Filll method to populate a DataSet.


Is there an easy way to do it the other way, going from a DataSet (or
DataTable) to an Excel spreadsheet?


Thanks!

-Scott
 
S

S Shulman

I don't know of any built in function that creates excel but ther one for
XML I just create CSV file (don't forget about the commas) or you may open
Excel document using office automation and populate the document
I can send you some sample code

hth,
Shmuel Shulman
 

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

Top