C# SQLite Parameterized Select Using LIKE -
i trying sql query such
select * [table] hostname '%myhostname%';
this works fine in plain sql, when use system.data.sqlite in c#, works literal, not parameter, such
string sel = "select * [table] hostname '%@host%'"; ... command.parameters.addwithvalue("@host", "myhostname");
this returns no results.
you can't that. parameters must complete values - it's not string substitution sql. instead:
string sel = "select * [table] hostname @host"; ... command.parameters.addwithvalue("@host", "%myhostname%");
Comments
Post a Comment