c# - What is the fastest way to retrieve a million records from an SQLite database file and display it in the WPF Datagrid? -


i have sqlite3 database file, mydatabase.sqlite having million rows , 50 columns (file size ~200mb). want load data file , display on wpf datagrid.

datatable dt = new datatable(); using (sqlitecommand cmd = new sqlitecommand("select * orders", conn)) {     using (idatareader rdr = cmd.executereader())     {         dt.load(rdr);     } } 

it takes around 54 seconds execute. sqliteadapter.fill(dataset) takes same amount of time. there faster way fetch data sqlite db ?

i recommend select sql table chunk chunk. example (top 200 second 200 , etc.). find number comfortable.

can using row_number in sql transact has documentation , example here.

after re-query new chunk of data database, add new row data table using this.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -