I have an SQLite database which has a table ‘myTable’ with columns ‘Date’ and ‘Value’. The ‘Date’ records are unique, that is there is only one row for each date.
I also have a text file with tab delimited “Date” / “Value” pairs.
What is the most efficient way to append the data from the text file into the SQLite table, so that only those “Date” / “Value” pairs are added which do not already present in the database?
I know how to do it by one row at a time: check if the “Date” / “Value” pair exists in the database, if not then insert it. But that does not seem to be efficient.
I was thinking about something like this: read the text file into a string, convert the string into an array, set DataTable source to the array, update SQLite table from DataTable using DataAdapter.
Is this possible to do and how to do that? Or there is a better way?