7

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

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

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

2 Answers 2

5

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.

Sign up to request clarification or add additional context in comments.

Comments

1

You could use the file helpers library if you want also.And well use the ado.net functionality too.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.