dimanche 27 décembre 2015

Sqlite WHERE LIKE statement c#

I have a variable 'fav' which will contain values separated by a comma such as "a,b,c". In Table1 I have a column called Name with values "a" "b" "c" in different rows. I would like for the query below to return a, b and c however it currently returns nothing and doesn't crash. Thanks for any help.

  public IEnumerable<Table1> Method1()
    {
        return conn.Query<Table1>("SELECT * FROM [Table1] WHERE [Name] LIKE '" + "%" + fav + "%" + "'");
    } 

Aucun commentaire:

Enregistrer un commentaire