I am developing a call logging app which gets its data from an old access database. That database is now tables only. The problem I am having is that the datagridview's take very long to load. (5-7 seconds) this is a tabbed app so everytime I go to a tab with a DGV I have to wait for it to load. Is there a way to speed this up. There is roughly 1000 lines to load for each DGV right now and each grid has 6 columns.
This is my first experience using VB with a database so I am sure the app is full of ineffiencies.
I was also trying to change the size of the columns when opening the tab containing the DGV. I edited this out and that did not seem to help the load time.
Thanks for any help you can provide.
This is my first experience using VB with a database so I am sure the app is full of ineffiencies.
VB.NET:
daCallLog = New OleDb.OleDbDataAdapter(UrgentSql, Login.con)
daCallLog.Fill(dsCallLog, "UrgentCallsDS")
daCallLog = New OleDb.OleDbDataAdapter(CustomersSql, Login.con)
daCallLog.Fill(dsCallLog, "MyCustomersDS")
daCallLog = New OleDb.OleDbDataAdapter(MyCallsSql, Login.con)
daCallLog.Fill(dsCallLog, "MyCallsDS")
DataGridView1.DataSource = dsCallLog.Tables("MyCallsDS")
DataGridView2.DataSource = dsCallLog.Tables("UrgentCallsDS")
DataGridView3.DataSource = dsCallLog.Tables("MyCustomersDS")
I was also trying to change the size of the columns when opening the tab containing the DGV. I edited this out and that did not seem to help the load time.
VB.NET:
If TabControl1.SelectedIndex = 3 Then
DataGridView1.Columns(0).Width = 80
DataGridView1.Columns(1).Width = 50
' DataGridView1.Columns(2).Width = 150
DataGridView1.Columns(3).Width = 65
DataGridView1.Columns(4).Width = 65
DataGridView1.Columns(5).Width = 50
End If
If TabControl1.SelectedIndex = 4 Then
DataGridView2.Columns(0).Width = 80
DataGridView2.Columns(1).Width = 50
'DataGridView2.Columns(2).Width = 150
DataGridView2.Columns(3).Width = 65
DataGridView2.Columns(4).Width = 65
DataGridView2.Columns(5).Width = 50
End If
If TabControl1.SelectedIndex = 5 Then
DataGridView3.Columns(0).Width = 200
DataGridView3.Columns(1).Width = 50
DataGridView3.Columns(2).Width = 150
DataGridView3.Columns(3).Width = 100
DataGridView3.Columns(4).Width = 100
DataGridView3.Columns(5).Width = 100
End If
Thanks for any help you can provide.