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

Can't set ConnectionString on closed connection #543

Closed
fuxuejun opened this issue Aug 6, 2018 · 2 comments
Closed

Can't set ConnectionString on closed connection #543

fuxuejun opened this issue Aug 6, 2018 · 2 comments
Assignees
Labels

Comments

@fuxuejun
Copy link

fuxuejun commented Aug 6, 2018

When MySqlCnnnection Close, don't change m_hasBeenOpened to false.
So,I can't set connection.ConnectionString wheen I call connection.Close().

@bgrainger
Copy link
Member

The following code fails, but it should work:

using (var connection = new MySqlConnection())
{
	connection.ConnectionString = connectionString1;
	connection.Open();
	connection.Close();

	connection.ConnectionString = connectionString2; // fails here
	connection.Open();
	connection.Close();
}

@bgrainger bgrainger added the bug label Aug 6, 2018
@bgrainger bgrainger changed the title When MySqlCnnnection Close, don't change m_hasBeenOpened to false. Can't set ConnectionString on closed connection Aug 6, 2018
@bgrainger bgrainger self-assigned this Aug 6, 2018
@bgrainger
Copy link
Member

Fixed in 0.44.0.

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