Skip to content

Out parameters not supported with sequential reader (breaking NpgsqlDataAdapter) #2091

@maximcus

Description

@maximcus

Hi!

I have a Postgre function which has 2 out integer parameters. I try to populate a DataTable with a call to instance method NpgsqlDataAdapter.Fill(DataTable dataTable). Before the call I set NpgsqlDataAdapter.SelectCommand to the appropriate command. This call succeeds when I use npgsql 3.2.7, but when I use npgsql 4.0.2 I get an exception:

System.NotSupportedException: Output parameters aren't supported with SequentialAccess
    in Npgsql.NpgsqlCommand.<ExecuteDbDataReader>d__100.MoveNext()
--- --- ---
   in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   in Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   in System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   in System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
   in System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
   in ...

The same problem exists with NpgsqlDataAdapter.Fill(DataSet dataSet)

I would like to know, is it a known breaking change, a bug, or maybe I am doing something I'm not supposed to.
If you need more info, I will provide a code sample.

Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions