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的查询字符串的参数顺序一致,不能改动。

05-11 20:04