Click here to Skip to main content
15,443,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am in need to import an Excel file into a Sqlite Table by clicking a button.
Use open file dialog select file and insert into table. I searched the Net with
no clear answer. Can someone send me a link or code sniplet?

What I have tried:

Lots of reading and looking on the Net
Updated 8-Apr-21 23:02pm

Start by reading the data from Excel: google will show you many ways to do that, but it will depend on the environment in which you are running. For example, a web-based environment cannot use a solution which expects Excel to be installed, and so on.
Find one that fits your needs, and make sure it works into your code: a DataTable is probably a good storage medium here.

Then google for how to save a DataTable to an existing table in SqLite - again, you will find loads of examples.

The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements."[^]
That's not the same thing as "have a quick google and give up if I can't find exactly the right code". You should expect to have to work with multiple operations and change code to fit what you need rather than just "bolt it together" or hope that someone will do your work for you ...
Share this answer
See Working with MS Excel(xls / xlsx) Using MDAC and Oledb[^] for how to extract the data from Excel worksheets. And System.Data.SQLite: Home[^] for SQLite.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900