简单的说 access 神经病的
update 时传参数要按顺序传
错误:
OleDbParameter[] parameters = new OleDbParameter[]{ AccessHelper.Parameter("@name", name) AccessHelper.Parameter("@content", content,OleDbType.LongVarWChar) };
正确:
OleDbParameter[] parameters = new OleDbParameter[]{ AccessHelper.Parameter("@content", content,OleDbType.LongVarWChar), AccessHelper.Parameter("@name", name) }; if (AccessHelper.ExecuteNonQuery("UPDATE [text] set [content]=@content where [name]=@name ", parameters) > 0)