我用的是command,修改语句的影响行数不等于1一般会是什么问题呢?代码如下:OleDbCommand updatecmd= new OleDbCommand(updateSQL,oleCon);
updatecmd.Parameters.Add("@username",OleDbType.Char,20);
updatecmd.Parameters.Add("@Newpassword",OleDbType.Char,30);
updatecmd.Prepare();
updatecmd.Parameters["@username"].Value = this.usertext.Text.Trim();
updatecmd.Parameters["@Newpassword"].Value=this.newtext.Text.Trim();
if(updatecmd.ExecuteNonQuery() == 1)
MessageBox.Show("修改成功");
else
MessageBox.Show("修改失败");
结果是修改失败,我仔细检查过了,参数传递没有问题啊!!
哪个高手知道啊
updatecmd.Parameters.Add("@username",OleDbType.Char,20);
updatecmd.Parameters.Add("@Newpassword",OleDbType.Char,30);
updatecmd.Prepare();
updatecmd.Parameters["@username"].Value = this.usertext.Text.Trim();
updatecmd.Parameters["@Newpassword"].Value=this.newtext.Text.Trim();
if(updatecmd.ExecuteNonQuery() == 1)
MessageBox.Show("修改成功");
else
MessageBox.Show("修改失败");
结果是修改失败,我仔细检查过了,参数传递没有问题啊!!
哪个高手知道啊
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货