0
private int GetNextId()
{
SQLiteConnector conn = new SQLiteConnector(false);
conn.OpenConnection();
cmd = new SQLiteCommand("SELECT @id_account = MAX(id_account) FROM account");
SQLiteParameter param = new SQLiteParameter("@id_account", DbType.Int32);
param.Direction = ParameterDirection.Output;
cmd.Parameters.Add(param);
cmd = conn.ExecuteReadeOutput(cmd);
conn.Close();
return int.Parse(cmd.Parameters["id_account"].Value.ToString()) + 1;
}
...
public SQLiteCommand ExecuteReadeOutput(SQLiteCommand cmd)
{
conn.Open();
cmd.Connection = conn;
reader = cmd.ExecuteReader();
reader.Close();
return cmd;
}
當我打電話GetNextId()
會出現以下錯誤的方法:Finisar公司的SQLite問題與ParameterDirection
Specified argument was out of the range of valid values.
在行:
param.Direction = ParameterDirection.Output;
任何想法?
謝謝。