|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Exporting from a DataTable or DataViewUsing 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? -- Michael Hockstein On Wed, 7 Feb 2007 05:02:01 -0800, michael <howlinghound@nospam.nospam> wrote:
¤ 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. -- Show quoteMichael Hockstein "Paul Clement" wrote: > On Wed, 7 Feb 2007 05:02:01 -0800, michael <howlinghound@nospam.nospam> wrote: > > ¤ 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) > 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 |
|||||||||||||||||||||||