Hi,
I'm executing the following query on a SQL Server 2005 database via a vb.net application:
"SELECT FullName, Email, State, Country, Phone, Fax " & _
"FROM Customers " & _
"WHERE company LIKE '" & nameCompany & "%'"
nameCompany is a variable in my program.
My problem is that sometimes the name of the company contains an apostrophe (for example: Wireless's) and I have an error (incorrect syntax).
I've tried to replace the apostrophes by double quotes but it's not working.
Can anyone have a solution please ?
Thank you
Seb
I'm executing the following query on a SQL Server 2005 database via a vb.net application:
"SELECT FullName, Email, State, Country, Phone, Fax " & _
"FROM Customers " & _
"WHERE company LIKE '" & nameCompany & "%'"
nameCompany is a variable in my program.
My problem is that sometimes the name of the company contains an apostrophe (for example: Wireless's) and I have an error (incorrect syntax).
I've tried to replace the apostrophes by double quotes but it's not working.
Can anyone have a solution please ?
Thank you
Seb