Error in LIKE Operator in Dataview Row Filter

Posted by Sankar20092010 under VB.NET on 9/29/2012 | Points: 10 | Views : 8360 | Status : [Member] | Replies : 6
Hi.....

I have a search pop up form in VB.NET. Suppose it has a text box for searching and a datagridview. The field name to be searched is employee name.
I want the output needed as described below.

On typing employee name as 'a*' i want all employees starting with a or contains a.
On typing employee name as 'a*a' and error is coming . i want to know how to escape wild characters like '*', '[', '%' , ''"

suppose i want to search 'sunil's*' how it is possible.

Thanks and Regards

Sankar




Responses

Posted by: Jayakumars on: 9/29/2012 [Member] [MVP] Bronze | Points: 25
Posted by: Jayakumars on: 9/29/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
Please mark as answer if it helpful to you.


Mark as Answer if its helpful to you

Sankar20092010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sankar20092010 on: 9/29/2012 [Member] Starter | Points: 25

Up
0
Down
hi jayakumars,

i already tried these 3 websites but it is not possible. i am calling that function in text changed event it goes like recursion also.
Can any one post a simple example to illustrate this.
Regards
Sankar
sankar20092010@gmail.com

Sankar20092010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 9/29/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
you need gridview search purpose row filter like query ?
or post your code here.

Mark as Answer if its helpful to you

Sankar20092010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jayakumars on: 9/29/2012 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi
sankar
refer this url working good.

http://www.dotnetfunda.com/codes/code3292-how-to-use-dataview-and-bind-the-gridview-with-like-query.aspx


Dont Forgot Please mark as answer if it helpful to you.



Mark as Answer if its helpful to you

Sankar20092010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sankar20092010 on: 9/30/2012 [Member] Starter | Points: 25

Up
0
Down
hi jayakumars,

Ya this url is fine. but inside that i found the line

dv.RowFilter = "ProductName like '%Mouse%'"; its work fine for me and we are doing an windows applicattion also. But my problem is
when typing '*mouse" or "*mouse*" its should be give the same result. But here a validation should be added that "*mous*e'" should not be there since
it will give an error in Like operator. Hope u understood , please reply as soon as possible,

Thanks very much
Sankar
sankar20092010@gmail.com



Sankar20092010, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response