导入/导出CSV从SQLite的从C#codeCSV、SQLite、code

由网友(拼了命做自己)分享简介:我试图找出一个EAZY方式来加载CSV文件导入的SQLite数据库使用System.Data.SQLite I am trying to figure out an eazy way to load CSV file into SQLite DB using System.Data.SQLite我看到了命令行的方式...

我试图找出一个EAZY方式来加载CSV文件导入的SQLite数据库使用System.Data.SQLite

I am trying to figure out an eazy way to load CSV file into SQLite DB using System.Data.SQLite

我看到了命令行的方式来做到这一点,即 .IMPORT mydata.csv mytable的

I saw commandline way to do that i.e .Import mydata.csv mytable

但我需要通过C#code做到这一点。你知道吗?

But I need to do this via C# code. Any Idea?

推荐答案

您可以创建的OleDbConnection 来CSV文件(它只是谷歌,这是很容易),然后加载行到数据集,然后将数据集中到sqlite的由 SqliteConnection 。几行code。

you can create OleDbConnection to CSV file (just google it, it is very easy) then load rows to DataSet, then put that dataset into Sqlite by SqliteConnection. Few lines of code.

阅读全文

相关推荐

最新文章