SQLite.Net-PCL
SQLite.Net-PCL copied to clipboard
Raw sql command - string equals string
Lets say I have a simple table
public class Product
{
public int Id { get; set;}
public string Name { get; set; }
}
and want to select products with property Name equals to some string condition, so
Connection.Query<Product>("SELECT * FROM Product WHERE Name = '?'", "ASDF1234")
empty query is returned, I have same problem with ... LIKE '%?%'. When I go through LINQ, everything is fine
Connection.Table<Product>().Where(x => x.Name == "ASDF1234")
but I want to select specific columns (SELECT col1 ...) only so I have to write raw SQL.
It looks like there are some problems with strings in conditions, or am I doing something wrong?