I'm trying to filter a DataGridView using a filter based on the text entered into a Text Box. The SQL Server Query looks like
SELECT *
FROM <TableName>
WHERE (<TableField> LIKE ?)
I would like to use Wildcard to find records. So for example I have a Search FIeld <ForField> and I would like to find records using <ForField> and wildcards but I cannot seem to get the syntax right.
If I wanted to modify the <ForField> how would I do it to
Find all records with <tableField> starting with <ForField>
Find all records with <TableField> ending with <ForField>
Find all records with <ForField> anywhere in <TableField>
For example, I have tried <ForField> & "%" for the first case, but it didn't work.
Start Free Trial