Access“存储过程"参数顺序要与执行代码生成的参数顺序一致
OleDbParameter olp; OleDbCommand cmd = new OleDbCommand("insertYjsData"); olp = new OleDbParameter("@unitengID", OleDbType.Integer); olp.Value = DBNull.Value; cmd.Parameters.Add(olp); olp = new OleDbParameter("@xh",OleDbType.VarChar); olp.Value = record1.Xh; cmd.Parameters.Add(olp); olp = new OleDbParameter("@record_id", OleDbType.Integer); olp.Value = recordId; cmd.Parameters.Add(olp);
如题,否则会报"标准表达式中数据类型不匹配"的错误。例如以上代码的参数顺序要与Access的查询字符串的参数顺序一致,不能改动。
本文来自博客园,作者:NLazyo,转载请注明原文链接:https://www.cnblogs.com/bile/p/3328265.html