When operating SQL and access databases and passing like parameters for Fuzzy queries, you can use the following method:
SQL:
String SQL = "select count (ID) as rcount from tbarticle where classid in (" + IDs + ") and title like '%' + @ title + '% '";
The parameters are passed as follows:
Sqlparameter [] SPS = new sqlparameter [1];
SPS [0] = sqldb. createparameter ("@ title", sqldbtype. varchar, title, 50, parameterdirection. Input );
Title is a variable.
In the above two databases, this can be used to query the content, but it is not allowed in SQLite. After several attempts, it is found that such fuzzy parameter transmission can also be implemented in the form of substitution.
SQL:
String SQL = "select count (ID) as rcount from tbarticle where classid in (" + IDs + ") and title like @ title ";
Parameters:
Sqliteparameter [] SPS = new sqliteparameter [1];
SPS [0] = SQLite. createparameter ("@ title", dbtype. String, "%" + title + "%", 50, parameterdirection. Input );
It is directly simulated into '% test %' in the variable, pass this in, you can find the result.