Skip to content

Commit 69c21b0

Browse files
committed
Change to InvalidOperationException.
This matches the (future) behaviour of Microsoft.Data.Sqlite: aspnet/Microsoft.Data.Sqlite@8e4db99#diff-0561eef0368965f9acff5b0472c65fc6
1 parent 188d6ee commit 69c21b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/MySqlConnector/MySql.Data.MySqlClient/MySqlCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public override void Prepare()
9292
set
9393
{
9494
if (m_connection?.HasActiveReader ?? false)
95-
throw new MySqlException("Cannot set MySqlCommand.Connection when there is an open DataReader for this command; it must be closed first.");
95+
throw new InvalidOperationException("Cannot set MySqlCommand.Connection when there is an open DataReader for this command; it must be closed first.");
9696
m_connection = value;
9797
}
9898
}

0 commit comments

Comments
 (0)