Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
1.00/5 (1 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

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.
 
Share this answer
 
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900