Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btnRefresh_Click(object sender, EventArgs e)
- {
- string connection = "server=localhost;database=teste_etb;user=root;password=******";
- MySqlConnection con = new MySqlConnection(connection);
- con.Open();
- MySqlCommand command = new MySqlCommand();
- command.Connection = con;
- MySqlDataAdapter MyDA = new MySqlDataAdapter();
- sqlSelectAll = "SELECT * from conteudos";
- MyDA.SelectCommand = new MySqlCommand(sqlSelectAll, con);
- DataTable table = new DataTable();
- MyDA.Fill(table);
- BindingSource bSource = new BindingSource();
- bSource.DataSource = table;
- dataGridView1.DataSource = bSource;
- con.Close();
- }
- private void txtSearch_TextChanged(object sender, EventArgs e)
- {
- DataView dv = new DataView(table);
- dv.RowFilter = string.Format("Nome LIKE '%{0}'");
- dataGridView1.DataSource = dv;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement