Problem using select for find a record in dataset

I am trying to find a record in dataset using select but it isn't work when i run my application show this error message "the especified conversion it isn't valid."
my code is:

Dim strFilterCriteriaAsString

strFilterCriteria = "Nombre = '" & _

TextBox1.Text.ToString & "'"

Dim tablavendedorAs DataTable'= New Vendedordataset.VendedorDataTable()

Dim filavendedor()As Vendedordataset.VendedorRow

tablavendedor = Vendedordataset1.Tables("Vendedor")

Try

filavendedor = tablavendedor.Select(strFilterCriteria)

Catch erAs System.Exception

MsgBox(er.Message)

EndTry
Thanks

[1516 byte] By [AntonioGalvan] at [2007-12-16]
# 1
HI,
Instead of Declaring an array of Vendedordataset.VendedorRow as the array to contain the result, try using a simple DataRow array.

Dim filavendedor() As DataRow

cheers,
Paul June A. Domag

PaulDomag at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 2
Tony,

It will probably work if you cast the result from the Select to your VendedorRow. I believe the VB syntax for that is to use CType(), like this:




filavendedor
= CType(tablavendedor.Select(strFilterCriteria),Vendedordataset.VendedorRow)

BonnieB at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified