Find row using * wildcard or similar (Like) with dataview/dataTabl

G

Guest

Is it possible to use a wildcard like feature with Dataview.Find? Actually,
I tried that but did not get any rows. Is there some wildcard like feature
of the dataview or some other object that I could search/find rows in an
ADO.Net dataTable?

Or, am I stuck having to write a loop and search the loop for a substring of
an expression?
 
G

Guest

Rich,

I think that Dataview.Find expects a key and looks for an exact match.

On the other hand, Datatable.Select will let you use the Like operator and
wildcards.

Kerry Moorman
 
J

jayeldee

Is it possible to use a wildcard like feature with Dataview.Find? Actually,
I tried that but did not get any rows. Is there some wildcard like feature
of the dataview or some other object that I could search/find rows in an
ADO.Net dataTable?

Or, am I stuck having to write a loop and search the loop for a substring of
an expression?

If you're searching text fields I know you can use
Table.Rows.Select("FieldName Like '%whatever%'") to return all the
rows that have the FieldName column matching 'whatever' in any part of
it. It returns them into an array of DataRow objects you can iterate
through.
 
C

Cor Ligthert [MVP]

Kerry,

I always have that same idea like you, however the Select Expression is
AFAIK the same as the rowfilter Expression, therefore I would not know why
it would not work.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top