Skip to content

Commit c25ef03

Browse files
committed
Change exception when setting connection string on open connection.
1 parent 56da11a commit c25ef03

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Data;
44
using System.Data.Common;
5-
using System.Linq;
65
using System.Net.Sockets;
76
using System.Threading;
87
using System.Threading.Tasks;
@@ -178,7 +177,7 @@ public override string ConnectionString
178177
set
179178
{
180179
if (m_hasBeenOpened)
181-
throw new MySqlException("Cannot change connection string on a connection that has already been opened.");
180+
throw new InvalidOperationException("Cannot change connection string on a connection that has already been opened.");
182181
m_connectionStringBuilder = new MySqlConnectionStringBuilder(value);
183182
m_connectionSettings = new ConnectionSettings(m_connectionStringBuilder);
184183
}

0 commit comments

Comments
 (0)