I'm trying to filter a bindingSource but I get an error when the filter string has an apostrophe in it.
eg:
dim ln as string = TbxLastName.text
BindingSource.Filter = "LastName like '" & ln & "%'"
This works fine unless the last name has an apostrophe in it, I tried adding a double apostrophe ln.replace("'", "''")but it still doesn't work. I get the error message
"The expression contains an invalid string constant: '."
Any suggestions?
Perrin
eg:
dim ln as string = TbxLastName.text
BindingSource.Filter = "LastName like '" & ln & "%'"
This works fine unless the last name has an apostrophe in it, I tried adding a double apostrophe ln.replace("'", "''")but it still doesn't work. I get the error message
"The expression contains an invalid string constant: '."
Any suggestions?
Perrin