c# export dataset

Posted on 2006-10-27
Last Modified: 2012-06-21
how do i export dataset to excel?
Question by:bman9111

Expert Comment

ID: 17821627
Since Excel accepts XML output, I would serialize the dataset using XMLSerializer.

Author Comment

ID: 17824165
not sure how to do that. When I write the dataset to xml using something like

it doesnt come out right.
LVL 12

Accepted Solution

sumix earned 250 total points
ID: 17824957

You have a class here that has a static method 'Export', that you can use to export a dataset to an excel file using OleDb:

 (rename the file with .cs extension and add it to your project)

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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