参数顺序
时间:2011-03-02 来源:双魂人生
public static void UpdateUserName(AdminInfo admininfo)
{
string sqlstr = "update T_Admin set AdminName=@AdminName where Id=@Id";
DBHelp.GetExecuteNonQuery(sqlstr,new OleDbParameter("@Id",admininfo.Id),new OleDbParameter("@AdminName", admininfo.AdminName));
}
最后没执行任务操作
参数顺序换过之后:
public static void UpdateUserName(AdminInfo admininfo)
{
string sqlstr = "update T_Admin set AdminName=@AdminName where Id=@Id";
DBHelp.GetExecuteNonQuery(sqlstr,new OleDbParameter("@AdminName", admininfo.AdminName),new OleDbParameter("@Id",admininfo.Id));
}
执行了操作
可见参数位置也很重要,晕死
相关阅读 更多 +