Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
xtomik opened this issue Aug 11, 2020 · 2 comments
Closed
Assignees
Labels

Comments

@xtomik
Copy link

xtomik commented Aug 11, 2020

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
@bgrainger bgrainger self-assigned this Aug 11, 2020
@bgrainger bgrainger added the bug label Aug 11, 2020
@bgrainger
Copy link
Member

Pre-release fix available in 1.0.1-beta.0.22 at GitHub Packages: https://github.com/mysql-net/MySqlConnector/packages/39735

@bgrainger
Copy link
Member

Fixed in 1.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants