Exporting from a DataTable or DataView

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
¤ 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)
 
Thanks. That's what I thought. I use xPort tools and really like it. Wondered
if there was a native .NET way.
 
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
 
Back
Top