如何将CSV文件读入.NET Datatable [英] How to read a CSV file into a .NET Datatable

查看:161
本文介绍了如何将CSV文件读入.NET Datatable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 CSV 文件加载到 System.Data.DataTable 中,创建<$ c $基于 CSV 文件?

How can I load a CSV file into a System.Data.DataTable, creating the datatable based on the CSV file?

$ c> ADO.net 功能允许这样做?

Does the regular ADO.net functionality allow this?

推荐答案

数据转换为数据类型,使用数据结构创建DataTable:

Here's an excellent class that will copy CSV data into a datatable using the structure of the data to create the DataTable:

用于平面文件的便携和高效的通用解析器

它易于配置和易于使用。我敦促你看看。

It's easy to configure and easy to use. I urge you to take a look.

这篇关于如何将CSV文件读入.NET Datatable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆