c#-关于C#更新mysql数据库结果异常问题,求大神帮忙
程序员文章站
2022-06-07 16:49:04
...
mysqlc#数据库
本人代码如下
CommonFormService.updateScore(transaction, userid, kindid, score, righttime, maxConright, maxConWrong, successRate, equispaced, nowConrightWrong, qishu, sellid);
在整个方法中多次调用此段代码,只是其中参数不同。updateScore方法代码如下
public static void updateScore(Transaction transaction, string userid, string kindid, int score, int righttime, int maxConRight, int maxConWrong, int successRight, int epaced, int nowRightWorng, int qishu, string sellid) {//`uId` int,`kId` int,`scre` int,`rTime` int,`mConRight` datetime,`maxWorng` int, //`sRate` int,`epaced` int,`nowRightWorng` int,`sllID` int,`qs` int try { string sql = "select InsertScore(" + userid + "," + kindid + "," + score + "," + righttime + "," + maxConRight + "," + maxConWrong + "," + successRight + "," + epaced + "," + nowRightWorng + "," + sellid + "," + qishu + ") "; DataOperater.Sql_FillDataTabelMysql(transaction,sql); } catch (Exception e) { } }
如上述代码所示并没有对任何数据有特殊处理,只要数据类型正确即可更新数据库,但是待执行的时候差不多调用了30多次updateScore这个方法 ,其他的都没问题,但是其中一次updateScore里的 sql=" select InsertScore(16,37,11,8,6,1,80,0,1,0,10)"的时候虽然VS提示操作成功,去查询数据库的时候数据没有更新进去,数据不能正常跟新到数据库中,但是当吧
select InsertScore(16,37,11,8,6,1,80,0,1,0,10)这个写到另一个小的C#程序中时执行却成功了,并且把它复制到navicat里面执行也没有问题,请问这是怎么回事啊?以前碰上的问题还可以找到一些错误提示,但是现在这个问题,连个错误提示都找不到 ,感觉很诡异。有大神遇到过这样的问题吗?求助~~~