单身& sql字符串中的双引号问题。 [英] Single & double quotes problem in sql string.
问题描述
请看我的问题,我在asp.net C#中有一个表单,在表单中,我使用了Tiny-Mac Editor来自定义内容,我的问题是,每当我按下按钮然后我就会面临这个问题(单引号和双引号问题。
INSERT INTO tblExplanation VALUES(260915,''Peel and Stick Floral Wall Art' ',''将你的卧室改造成一个明亮的,蓬勃发展的草地,拥有这套多彩的墙壁艺术。每一朵独特的花,鸟,蝴蝶和旋涡的太阳都是多彩的乙烯基充满生命的多彩创造如何最好地安排它们完全取决于你 - 和你的12.2x 15.4''
这里我有单引号和双引号我希望在列中插入相同的值
例如a)12.2x 15.4
b)转换你的'tot' 's
请提供最佳解决方案
感谢先进
braj KIS hor
please see my problem, i have a form in asp.net C#, and inside the form, i have used Tiny-Mac Editor for customise content, my problem is that, whenever i press the button then i face this problem( single & double quotes problems).
INSERT INTO tblExplanation VALUES ("260915",''Peel and Stick Floral Wall Art'',''Transform your tot''s bedroom into a bright, burgeoning meadow with this set of oh-so-colorful wall art. Each unique flower, bird, butterfly, and swirly sun is a colorful creation of multilayered vinyl brimming with life and energy. How best to arrange them is entirely up to you--and your 12.2" x 15.4"'')
here i have single quote and double quote in same value which i want to insert in a column
eg a) 12.2" x 15.4"
b) Transform your tot''s
please suggest best solution
thanks in advanced
braj kishor
推荐答案
你的基本问题是你在做什么,是错的。您永远不应该使用字符串mashing来构建SQL。您应该使用参数化查询 [ ^ ]或存储过程。
Your basic problem is that what you''re doing, is wrong. You should never use string mashing to build SQL. You should use paramaterized querys[^], or stored procedures, always.
这篇关于单身& sql字符串中的双引号问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!