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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -