Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Practica12_DataGridView con Filtro
- Imports System.Data.OleDb
- Public Class Form1
- Dim cnn As New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=peliculas.mdb;User ID=admin;Password=;")
- Dim da As New OleDbDataAdapter("Select * From peliculas", cnn)
- Dim ds As New DataSet
- Dim dv As DataView
- Sub TextBox1TextChanged(sender As Object, e As EventArgs)
- End Sub
- Sub CmdLlenarClick(sender As Object, e As EventArgs)
- 'Llenar el DataGrid con valores de la tabla peliculas
- da.Fill(ds)
- 'dataGridView1.DataSource = ds.Tables(0)
- dv = ds.Tables(0).DefaultView
- dataGridView1.DataSource = dv.Table
- End Sub
- Sub Button1Click(sender As Object, e As EventArgs)
- 'Aqui va el filtro
- dv.RowFilter = "IDGenero like '%" & textBox1.Text & "%'"
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement