FastReport
FastReport copied to clipboard
FillTableData in DataConnectionBase overwrites CommandType set by GetAdapter in FastReport.Data.OracleODPCore.OracleDataConnection
In FillTableData
method of DataConnectionBase.cs
using (DbDataAdapter adapter = GetAdapter(selectCommand, conn, parameters))
{
adapter.SelectCommand.CommandType = dataSource is ProcedureDataSource ? CommandType.StoredProcedure : CommandType.Text;
adapter.SelectCommand.CommandTimeout = CommandTimeout;
In GetAdapter
method of FastReport.Data.OracleODPCore.OracleDataConnection.cs
// if we have refcursor parameter, set its direction to output, and also
// modify the command type to CommandType.StoredProcedure. The selectCommand must contain
// the stored proc name only.
if (parType == OracleDbType.RefCursor)
{
parameter.Direction = ParameterDirection.Output;
adapter.SelectCommand.CommandType = CommandType.StoredProcedure;
}
So, the code in GetAdapter
could be setting the CommandType of the SelectCommand to CommandType.StoredProcedure
but that could be overwritten by adapter.SelectCommand.CommandType = dataSource is ProcedureDataSource ? CommandType.StoredProcedure : CommandType.Text;
in FillTableData
and prevent the stored procedure from being called correctly.
Thank you for reporting, we will look into improving this code.
Hello!
Our developers managed to solve the problem according to your request, expect a fix in the next version of FastReport Community Edition
Best regards, Bogdan