Click here to Skip to main content
15,886,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Select * from product where productname="Frame: Aluminum Tube C6 x 2 1/2" Flangex 170" Wall x 21'-0" w/ Powder Coat"


My table

prodid productname

133 Frame: Aluminum Tube C6 x 2 1/2" Flangex 170" Wall x 21'-0" w/ Powder Coat


Error: Unclosed quotation mark after the character string ' w/ Powder Coat''.
Posted

1 solution

Simple solution, that not only remedies your current problem but also

- avoids the risk of potential SQL-Injection in case you're developing an application where strangers can make inputs that get saved into the database and

- makes your code more structured and better readable:

SQL-Parameters.

Example here:
http://www.dotnetperls.com/sqlparameter[^]

MSDN-Doc:
https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparameter%28v=vs.110%29.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900