将数据从数据集导出到csv格式
问题描述:
大家好,
我有一个aspx页面,我将数据库中的数据加载到数据集中。
我也有一个用户下载单击超链接时加载的数据的选项。
我需要将数据集中存储的数据导出为CSV格式。
当用户点击超链接时,我应该向他显示csv文件所在的文件。你们中的任何人都可以给我C#所需的代码吗?
提前谢谢。
Hi all,
I hav an aspx page where I load the data from database into a dataset.
Also I have an option for the user to download the data loaded when he clicks on a hyperlink.
The thing is I have a requirement where I need to Export the data stored in dataset to CSV format.
And when user clicks on the hyperlink I should show him the file where the csv file is present.Can anyone of you give me the code required in C#?
Thanks in advance.
答
看这里:
将DataTable导出为CSV文件格式 [ ^ ]
将数据集导出为CSV [ ^ ]
如果需要,请在此处查看更多信息: Google搜索结果 [ ^ ]
Look here:
Exporting DataTable to CSV File Format[^]
Exporting Dataset as CSV[^]
If needed, look here for more: Google search result[^]
推荐此博客
http://weblogs.asp.net/kannanambadi/archive/2008/03/25/exporting-dataset-as-csv.aspx [ ^ ]
http://forums.asp.net/t/1460836.aspx/1 [ ^ ]
Refer this blogs
http://weblogs.asp.net/kannanambadi/archive/2008/03/25/exporting-dataset-as-csv.aspx[^]
http://forums.asp.net/t/1460836.aspx/1[^]