FastReport icon indicating copy to clipboard operation
FastReport copied to clipboard

FillTableData in DataConnectionBase overwrites CommandType set by GetAdapter in FastReport.Data.OracleODPCore.OracleDataConnection

Open butlerpeter opened this issue 1 year ago • 1 comments

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.

butlerpeter avatar Jan 29 '24 11:01 butlerpeter

Thank you for reporting, we will look into improving this code.

Alekarfes avatar Feb 09 '24 07:02 Alekarfes

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

BogdanStegachev avatar Apr 24 '24 14:04 BogdanStegachev