加数据时操作符丢失问题,,请帮忙!!

zc1972 2005-12-31 02:50:32
我做了一个数据增加页面,代码基本是这样,

string sContent = Request.Form("d_content")
...
string sql1 = "insert into news(title,content,typeid,Picture) values('" + sTitle + "','" + sContent + "','" + List.SelectedItem.Value + "','" + sPicture + "')";
executesql(sql1)

加一般数据时正常,但在加含有html格式的数据时有时出现“操作符丢失在 
<P class=MsoNormal style="TEXT-ALIGN: center" align=center><SPAN style="FONT-SIZE: 18pt;

FONT-FAMILY: 黑体; mso-ascii-font-family: 'Times New Roman'......”

怎么办???
...全文
88 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xuStanly 2006-01-01
  • 打赏
  • 举报
回复
replace(yourstring,"'","")
zc1972 2005-12-31
  • 打赏
  • 举报
回复
有资料说“按参数方式提交”,这是什么意思??是怎么做?
zc1972 2005-12-31
  • 打赏
  • 举报
回复
up~~~~~~~~~~~~~~~~~~~~~~~~
李睿_Lee 2005-12-31
  • 打赏
  • 举报
回复
你提交的html格式的数据中含有单引号,要处理后才能执行。

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧