Advertisement
idsystems

VBNETBD_Practica12

Mar 15th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.90 KB | None | 0 0
  1. 'Practica12_DataGridView con Filtro
  2. Imports System.Data.OleDb
  3.  
  4. Public Class Form1
  5.         Dim cnn As New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=peliculas.mdb;User ID=admin;Password=;")
  6.         Dim da As New OleDbDataAdapter("Select * From peliculas", cnn)
  7.         Dim ds As New DataSet
  8.         Dim dv As DataView
  9.  
  10.    
  11.     Sub TextBox1TextChanged(sender As Object, e As EventArgs)
  12.        
  13.     End Sub
  14.    
  15.    
  16.     Sub CmdLlenarClick(sender As Object, e As EventArgs)
  17.         'Llenar el DataGrid con valores de la tabla peliculas
  18.         da.Fill(ds)
  19.        
  20.         'dataGridView1.DataSource = ds.Tables(0)
  21.         dv = ds.Tables(0).DefaultView
  22.         dataGridView1.DataSource = dv.Table
  23.        
  24.                
  25.     End Sub
  26.    
  27.     Sub Button1Click(sender As Object, e As EventArgs)
  28.         'Aqui va el filtro
  29.         dv.RowFilter = "IDGenero like '%" & textBox1.Text & "%'"
  30.        
  31.     End Sub
  32. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement