首页 > 系统 > windows

System.Data.OleDb.OleDbException 操作必须使用一个可更新的查
时间:2014-08-25 19:02:27  点击: 来源:  作者:

1、ASP.NET网站出现以下错误,并且出错的页面有个修改点击率的更新数据库操作(程序没有代码错误): string strSql="UPDATE reference SET hit=hit+1 WHERE id="+i;2、错误提示如下: System.Data.OleDb.OleDbExceptio ...

1、ASP.NET网站出现以下错误,并且出错的页面有个修改点击率的更新数据库操作(程序没有代码错误):

string strSql="UPDATE reference SET hit=hit+1 WHERE id="+i;


2、错误提示如下:

System.Data.OleDb.OleDbException: 操作必须使用一个可更新的查询。 at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object&
executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at
System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at
System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at DDRS.FaqDetail.UpdateHit(Int32 i) in
d:/wwwroot/LG_vrd/FaqDetail.aspx.cs:line 64


3、故障原因:数据库没有给足相应权限
4、解决办法:开放读写权限,如下图所示
A、开放权限前:

B、开放权限后:

”您可通过以下微信二维码,赞赏作者“
 
 
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
推荐资讯
linux服务器同步互联网时间
linux服务器同步互联
亚马逊云lightsail服务器使用教程 | 亚马逊云lightsail使用指南
亚马逊云lightsail服
hostdare 4折优惠,直接降价60% 美国洛杉矶低至 $10.4/年 768M内存/1核/10gNVMe/500g流量
hostdare 4折优惠,直接
六类网线cat6a和cat6e的区别
六类网线cat6a和cat6e
相关文章
栏目更新
栏目热门

关于我们 | 广告服务 | 联系我们 | 网站地图 | 免责声明 | WAP | RSS


Copyright © 运维之家 2013-2023