views:

404

answers:

3

Hi Friends!

I have a requirement that , i have a table of 400 columns.

Here i need to Export this table to Excel sheet.

And i need to upload to Open Office Sheet. I do not have MS-office.

This is in ASP.NET and C#.NET

I am new to this concept.

So please help me to solve this.

And friends there is a problem , i have 400 columns , which is not possible to insert into Open Office Excel , i need to insert other columns into new sheet

Thank You All!!!!

+1  A: 

Have a look at this.

Seb
Nice link. Bookmarked it
CResults
A: 

Alternatively you can look at using OleDB to do this

Reading and Writing Excel Spreadsheets Using ADO.NET

I've used this method a number of times and found it to be quick and effective.

3rd Alternative, if it doesn't have to be a true xls/xlsx file and you want lots of control over what the final output looks like, try Microsoft's Spreadsheet XML.

XML Spreadsheet Reference

Again, I've used this method to great effect

CResults
A: 

You can read from one source and update to another using DataSet, with 2 distinct tOleDb connections.

Here's some code that does that.

CopyData-SqlToExcel-TwoOledbConnections.cs

Cheeso