I use a query that does the search in 3 different tables, return this query attribute in a Datatable
that will fill a Datagridview
.
The problem is that the search itself is a little time consuming, I used TOP
as a limiting but it still has a certain delay. I use an Access 97 database, all indexed tables.
Well, I would like to know if there is any way I can use a cache to speed up this query, or what I can improve on my query , this delay is sendable to me.
Follow the code:
SELECT TOP 10 Pedidos.Número, Clientes.RazaoSocial As [Cliente], vendedores.nome As [Vendedor], Pedidos.Data As [Data],
Format(Pedidos.Valor, '###,##0.00') As [VrPedido], Pedidos.Flag As [Flag], Pedidos.Status As [Status],Cliente As [codcli], Vendedor As [codVend]
FROM Pedidos, vendedores, Clientes
WHERE Lançamento = 0 And Pedidos.vendedor = Vendedores.código And Clientes.CodigoCliente = Pedidos.Cliente ORDER BY data desc, número desc
Populating the DataGrid:
DataGridView1.DataSource = Nothing
da = New OleDbDataAdapter(MySQL, Conexao)
dt = New DataTable
da.Fill(dt)
Me.DataGridView1.DataSource = dt