我遇到了麻烦,因为我对使用具有 Microsoft 访问权限的 OleDb 非常生疏。我将参数添加到命令中,然后执行查询,我得到“没有为一个或多个必需参数提供值”。
void LoadPositions(string accountKey, IEnumerable<Positions> positions)
{
OleDbCommand cmd1 = new OleDbCommand("delete from AccountPositions where BrokerAccountKey=?", conn, tran);
cmd1.Parameters.Add("?", OleDbType.VarChar).Value = brokerAccountKey;
cmd1.ExecuteNonQuery();
}
我已经束手无策了……救救别人!提前致谢。