Cita:
y se para en esta parte:Error en el operador like: el modelo de la cadena 'PEREZ%PEPITO%' no es valido
Código:
este es el codigo que utilizo:.DefaultView.RowFilter = "acestnomb like '" & TextBox1.Text & "%'"
Código:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim ds As DataSet Dim NOMBRE_TABLA As String = "acest" ds = emp.consulta("SELECT UNIQUE acestnreg,acestnomb,acestcarr,acestplan,acpertlfd,acpercelu,accondesc " & _ "FROM acest,acper,accon " & _ "WHERE acestnreg = acpernreg " & _ " AND accongrup = 18 " & _ " AND acconsubg = acestband ") DataGrid1.DataSource = ds.Tables("acest") Const MESSAGEBOX_CAPTION As String = "Buscar" ' Sanity check to make sure there's data before attempting to ' filter Debug.Assert(Not ds.Tables(NOMBRE_TABLA) Is Nothing, _ "No product data loaded in ProductData.Tables(NOMBRE_TABLA)") With ds.Tables(NOMBRE_TABLA) ' Filter the view so that only product names starting with a ' specified string are available. .DefaultView.RowFilter = "acestnomb like '" & TextBox1.Text & "%'" ' Are there any matching products? If .DefaultView.Count = 0 Then MessageBox.Show("No se encontro fila alguna.", _ MESSAGEBOX_CAPTION, _ MessageBoxButtons.OK, _ MessageBoxIcon.Question) End If ' By binding the grid to the DataView, the grid will now display ' only the matching rows. DataGrid1.DataSource = .DefaultView End With End Sub