Search code examples
asp.netsqldatasource

Asp.net: how to use jolly char against an integer field for a query in a datasource


Hy guys, my question is: if i have in asp.net, a SqlDatasource or AccessDatasource with the following select command: SELECT * FROM Mytable WHERE SomeFieldID=@FilterID

SomefieldID is an integer

And i would like to use the jolly char (* or %) to show all datas... how can i do?

Thanks to everybody will help...

Bye Stighy


Solution

  • It seems like a classic case of "when all you have is a hammer, everything looks like a nail". If you are trying to match "1%%" you actually mean >=100 and <=199. Similarly, when you try to match SomeFieldID LIKE "*3", you actually meant SomeFieldID % 10 = 3.