Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve data by using LIKE operator #1262

Open
gdonato022 opened this issue Dec 12, 2024 · 0 comments
Open

Retrieve data by using LIKE operator #1262

gdonato022 opened this issue Dec 12, 2024 · 0 comments

Comments

@gdonato022
Copy link

I'm trying to execute this query, but although it's not throwing an exception, I'm not getting any data (I'm sure there's data in the database).

 var sql = new StringBuilder(
     $@"
       SELECT * 
       FROM Airport 
       WHERE 
         
         AirportCity LIKE '%' + ? + '%' "
 );

var parameters = new List<object> { searchTerm };

db => db.QueryAsync<Airport>(sql.ToString(), parameters.ToArray())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant