I have a select statement
command.commandText = "SELECT FIRSTNAME, LASTNAME FROM MYTABLE" +
" WHERE STATE LIKE @STATE + '%';";
This gives me an “‘” error
I tried this one
command.commandText = "SELECT FIRSTNAME, LASTNAME FROM MYTABLE" +
" WHERE STATE LIKE @STATE" + "'%';";
This gives me ‘%’ error… What is the correct way
You must add % in actual parameter value, not in query:
If you have some value saved in string
valState, for example, just append%inAddWithValue: