0
Use a query searching in 3 different tables, returning this query attribute in a Datatable
that will fill a Datagridview
.
The problem is that the search itself, this a little time, I used the TOP
as a limiter but still takes some time. I use a Access database 97, all indexed tables.
Well, I wonder if there is any way I can use a cache to expedite this query, or what I can improve on my query, this delay is sent to me.
Follows 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
Filling in the Datagrid:
DataGridView1.DataSource = Nothing
da = New OleDbDataAdapter(MySQL, Conexao)
dt = New DataTable
da.Fill(dt)
Me.DataGridView1.DataSource = dt
I just found your code strange:
da = New OleDbDataAdapter(MySQL, Conexao)
... Mysql or Access?– gmsantos
Mysql, is only the variable that receives the SELECT query
– Felipe S