How to implement a wild card search on a Data Set

I need some help to implement a wild card search on data set that retrieves cached data
[87 byte] By [Adithya] at [2007-12-28]
# 1

u can use DataTable Select method to perform this

DataRow[] dr = DataSet1.Tables[0].Select ("Name Like '%ab'");

or u can use DataView.

DataView dv = DataSet1.Tables[0].DefaultView;

dv.RowFilter = "Name Like '%ab%'";

Bappi at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 2
I am not able to implement a wild card search of type A%a where i want to specify the first and last characters. It gives me an invalid expression error.
Adithya at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 3

A%a is not allowed in filter expressions. Check MSDN for more details. What you can do is set the filter expression like this

"Name Like 'A%' AND Name Like '%a'"

Try this hopefully this will work.

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

.NET Development

Site Classified