0

Hi ,
I have this problem, where I want the query to find slimier results,
Like '%BandName%'
for a static query it's easy, but when I use a string from a textBox I am not sure what should be the syntax.

public static DataRow SearchByBandName(string bandToFind)
    {
        return DbUtils.SelectDataRow("SELECT  * from  Bands  WHERE BandName Like @BandName",

Any clue?

Thanks,
Mot.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by motiofel
0

You have to post complete code so we can examine.

Now, I am guessing.

public static DataRow SearchByBandName(string bandToFind)
    {
        return DbUtils.SelectDataRow("SELECT  * from  Bands  WHERE BandName Like '%" + bandToFind + "%'");
  }
0

Thanks, it works great,
(and super fast reply might I add:)

if I would want to find also something like:
'band__Find' , how is it possible?


Thanks in advance,
Mot.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.