Hola a todos, tengo un DG en el cual busco datos, y cuando pongo pepito, me busca todo lo relacionado a pepito, pero si le dijito pepito%palotes, ahi me da el error.
Este es el codigo que tengo.
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 = "acdoc"
ds = emp.consulta("SELECT unique acdoccdoc,acdocnomb,acddotedo,acddocelu,acddoteof,acddonint " & _
"FROM acdoc,acddo " & _
"WHERE acdoccdoc = acddocdoc ")
DataGrid1.DataSource = ds.Tables("acdoc")
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 = "acdocnomb 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
Y el error salta en la linea:
.DefaultView.RowFilter = "acdocnomb like '%" & TextBox1.Text & "%'"
alguien me puede indicar por favor donde esta el error??
gracias