单个qoute(')的错误 [英] error of single qoute (')

查看:109
本文介绍了单个qoute(')的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本框,我想在SQL中存储文本框的值,但是当我在文本框中输入带有单个qoute('')的任何文本并单击保存"按钮然后给出错误时,请给出解决方案hurrey

谢谢您

i have a one textbox and i want to store textbox''s value in sql but when i enter any text with single qoute ('') in textbox and click save button then give a error please give a solution hurrey

thanks you

推荐答案

由于SQL注入,您希望避免将类似这样的字符引入您的数据中.这是我发现的链接(使用google),其中提供了有关您要执行的操作的信息.

http://it.toolbox.com/wiki/index.php/How_do_I_escape_single_quotes_in_SQL_queries%3F [a> [ ^ ]

我用这个短语Google搜索-字段中的sql引号".
You want to avoid allowing characters like that into your data due to SQL injection. Here''s a link I found (using google) that provides some info on what you''re trying to do.

http://it.toolbox.com/wiki/index.php/How_do_I_escape_single_quotes_in_SQL_queries%3F[^]

I googled with this phrase - "sql quote characters in field".


您需要使用参数.这是有关Code Project的另一篇好文章:

SQL注入攻击以及有关如何防止它们的一些提示 [
You need to use parameters. This is another good article here on Code Project:

SQL Injection Attacks and Some Tips on How to Prevent Them[^]

Nick


这篇关于单个qoute(')的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆