Skip to content

Parameter values are ignored if MySqlParameterCollection.Insert is used. #869

@xtomik

Description

@xtomik

If MySqlParameter is inserted into MySqlCommand.Parameters collection using MySqlParameterCollection.Insert, then the MySqlParameter.Value is not used.

var command = connection.CreateCommand();
var parameter = new MySqlParameter("@Id", MySqlDbType.Int32);
command.Parameters.Insert(0, parameter); 
parameter.Value = 5;
command.CommandText = "SELECT @Id";
var value = command.ExecuteScalar(); // returns DBNull

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions