Dim strSql As StringBuilder=New StringBuilder ()
StrSql. Append (" select * from MasterJ001 ")
'strSql. Append (" Where K_GUID=@ K_GUID and MasterID LIKE' % @ MasterID % '") that writing a check out
StrSql. Append (" Where K_GUID=@ K_GUID and MasterID LIKE '% %' "+ info. MasterID +" ") 'fuzzy query so that you can
Dim the parameters As SQLiteParameter ()={
New SQLiteParameter (" @ K_GUID, "DbType Guid),
New SQLiteParameter (" @ MasterID "DbType. String)
}
Turn notes that sentence, how to write to achieve fuzzy query
CodePudding user response:
Remove the K_GUID=@ K_GUID and this part,CodePudding user response:
'% @ MasterID %' writing should not line, you use {0}, {1} can not be like this? The string. Format (SQLSTR "ID", "MasterID")CodePudding user response:
StrSql. Append (" Where K_GUID=@ K_GUID and MasterID LIKE '% @ MasterID %' ")==the original statementsModified to
StrSql. Append (" Where K_GUID=@ K_GUID and MasterID LIKE @ MasterID ")
The value of the data before and after add % done
New SQLiteParameter (" @ MasterID "DbType. String '%' + 'data values' +' % ');//will to it
CodePudding user response:
New SQLiteParameter (" @ MasterID "DbType. String '%' + 'data values' +' % ');//will to itCodePudding user response:
WHERE SALARY LIKE '200%'
Find any value, begin from 200
WHERE SALARY LIKE '% 200%'
Find any value in 200, any location
WHERE SALARY LIKE '_00 %'
Find any value, 00 in the second and third place
WHERE SALARY LIKE '2 _ _ % %'
Find any value, starting from 2, the length of at least 3 characters
WHERE SALARY LIKE '% 2'
Find any value, ended up with 2
WHERE SALARY LIKE '_2%3'
Find any value, 2 at the end of the second location and 3
WHERE SALARY LIKE '2 ___3'
Find any value in a five digits, began to 2, and 3