Click here to Skip to main content
14,598,921 members
Rate this:
Please Sign up or sign in to vote.
how can i import Excel or CSV as table to sqlite database in Xamarin

What I have tried:

i already have class for that table
Posted
Updated 22-Jun-20 23:11pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You first need yo read the Excel/CSV and separate the fields into their correct columns for the table that you intend to insert them into. you can use Microsoft.Office.Interop.Excel Namespace | Microsoft Docs[^] or OLEDB with the Microsoft ACE driver.
   
Comments
mohammed mqi 23-Jun-20 21:38pm
   
i know but how can i import it to my table in SQLite DB
What are the procedures for doing this and is there a sample for that?
Richard MacCutchan 23-Jun-20 22:42pm
   
The procedures are as i suggested above. Read the Excel or CSV file row by row, and split the data into the separate fields that you want. For each row read in create the INSERT statement to add the data to your database. Some of the following links may provide more suggestions: excel to sqlite - Google Search[^].

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100