Filter value in Dataset

Posted by Jeyjey under ASP.NET on 4/9/2013 | Points: 10 | Views : 1141 | Status : [Member] | Replies : 4
Hi,

I am trying to filter a filename in dataset, below is my code

sQry=filename LIKE 'abcd%ef''%'
datarowFile = datasetFiles.Tables(0).Select(sQry)

But i am getting below error message while filtering the value in dataset

Error in Like operator: the string pattern 'abcd%ef'%' is invalid.

How to resolve the filter issue in dataset.

Thanks,
JJ




Responses

Posted by: Chandan88 on: 4/9/2013 [Member] Starter | Points: 25

Up
0
Down
use this way

str = "filename LIKE '%" + txtbox.text() + "%'";
ds.Tables[0].Select(str);

Chandan Singh

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

Posted by: Jeyjey on: 4/9/2013 [Member] Starter | Points: 25

Up
0
Down
Please giva a solution how to format this sQry=filename LIKE 'abcd%ef''%'


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

Posted by: Naraayanan on: 4/12/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,
can you explain your query with Example?

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

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

Posted by: Naraayanan on: 4/12/2013 [Member] Starter | Points: 25

Up
0
Down
HI
check this link
http://www.w3schools.com/sql/sql_wildcards.asp

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

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

Login to post response