Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. void CarregaGrid()
  2.         {
  3.             Conexão = new MySqlConnection("server=localhost;uid=root;pwd=etecjau;database=bd_vendas");
  4.             Adaptador = new MySqlDataAdapter("select Produtos.*, Categorias.descricao categoria from Produtos " +
  5.                                             "left join Categorias on Produtos.id_categoria = Categorias.id " +
  6.                                             "where Produtos.descricao like @Descricao order by Produtos.descricao", Conexão);
  7.             Adaptador.SelectCommand.Parameters.AddWithValue("@Descricao", txtPesquisa.Text + "%");
  8.             Adaptador.Fill(datTabela = new DataTable());
  9.             dgvProdutos.DataSource = datTabela;
  10.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement