Hi hope someone can help me
Read sqlite datatable is verry slow
I have a listview in detail mode with 45 columns.
and a datatable to add, read, delete and update datarows with 45 colums.
Only i have a problem to read the datatable and show it all in the listview, its verry slow
at the moment i have 10.000 datarows in the table and i have to wait about 6 seconds to load it to the listview.
Later there will be come about 10.000.000 and maby more datarows in the table so than i have to wait about 6000 seconds or almost 2 hours to load all the data
How can i make it faster.
the code i have is
Dim myCon As SQLiteConnection
myCon = New SQLiteConnection("Data Source=BurgerlijkeStand.db")
Dim dta As New DataTable
Dim ta As New SQLiteDataAdapter("SELECT * FROM Doopgegevens ORDER BY Landgedoopt, Provinciegedoopt, Gemeentegedoopt, Plaatsgedoopt ASC", myCon)
ta.Fill(dta)
Try
myCon.Open()
Dim myrow As DataRow
For Each myrow In dta.Rows
Dim lst As ListViewItem
lst = ListView1.Items.Add(If(myrow(0) IsNot Nothing, myrow(0).ToString, ""))
For m As Integer = 1 To dta.Columns.Count - 1
lst.SubItems.Add(If(myrow(m) IsNot Nothing, myrow(m).ToString, ""))
Next
Next
myCon.Close()
myCon.Dispose() : myCon = Nothing
Catch eSql As System.Data.SQLite.SQLiteException
MessageBox.Show("code 11e " & eSql.ToString)
End Try
Thanks i advice John