Skip to content

[Bug] Named or Positional parameters not working when using C# with NpgSql #4036

@PersistentProgrammer007

Description

C# Project Info

It's a simple Console app project just for testing ArcadeDB standalone server with C#,
These are the only dependencies:

<ItemGroup>
    <PackageReference Include="Dapper" Version="2.1.72" />
    <PackageReference Include="Npgsql" Version="10.0.2" />
</ItemGroup>

Important information

The connection does get established successfully between my C# app and ArcadeDB standalone server.
If I don't use Npgsql Named or positional parameters when passing and executing a query, it does work and i do get data.

Issue Details:

Code that Causes the Exception:

string targetName = "Keanu Reeves";
string cypherFilterQuery = @"{cypher} MATCH (p:Person {name: @Name}) 
                            RETURN p.name AS Name, p.born AS Born";

var person = await conn.QuerySingleAsync<Person>(cypherFilterQuery, new {Name = targetName});

Console.WriteLine($"Info on Keanu Reeves: {person.Name}, {person.Born}");

When above code is executed, this exception occurs:

Unhandled exception. Npgsql.PostgresException (0x80004005): XX000: Error on parsing bind message: Type with code 25 not supported for deserializing
at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
at Dapper.SqlMapper.QueryRowAsync[T](IDbConnection cnn, Row row, Type effectiveType, CommandDefinition command) in /_/Dapper/SqlMapper.Async.cs:line 489
at GraphDB_programs.Class1.Main(String[] args) in D:\POCs\GraphDB programs\Class1.cs:line 93
at GraphDB_programs.Class1.

(String[] args)
Exception data:
Severity: ERROR
SqlState: XX000
MessageText: Error on parsing bind message: Type with code 25 not supported for deserializing.

I would be thankful if this problem is solved.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions