Exporting from a DataTable or DataView

G

Guest

Using only .NET components (rather than 3rd party components), is there a way
to export data from a DataTable or DataView directly to an .xls or .csv file?
 
P

Paul Clement

¤ Using only .NET components (rather than 3rd party components), is there a way
¤ to export data from a DataTable or DataView directly to an .xls or .csv file?

There is no bulk method to perform the export. You would have to export line by line.

How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET
http://support.microsoft.com/kb/316934


Paul
~~~~
Microsoft MVP (Visual Basic)
 
G

Guest

Thanks. That's what I thought. I use xPort tools and really like it. Wondered
if there was a native .NET way.
 
W

WenYuan Wang

Hi Michael,
Thanks for Paul's reply.

As far as I know, we can use "Excel Automation" to transfer data from
dataset to Excel file.

http://support.microsoft.com/kb/306023/en-us
[How to transfer data to an Excel workbook by using Visual C# 2005 or
Visual C# .NET]

http://support.microsoft.com/kb/306022/en-us
[How to transfer data to an Excel workbook by using Visual Basic .NET]

If you just want to transfer data from dataset to CSV file, please
reference the following document.
http://www.dotnetspider.com/kb/Article1336.aspx
[Export Database Table to CSV file format]

I searched on internet for you and found there is a class library for
exporting. I hope this is helpful for you.
http://www.codeproject.com/aspnet/ExportClassLibrary.asp
[C# class library for exporting data to CSV/Excel file]

Hope this helps,
Best regards,
Wen Yuan
 

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