Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

MySQLConnection StateChange (1 reply)

$
0
0
Hi,

I'm using MySql.Data.dll 6.9.8.0 to connect to a DB in C#, something like this:

(private fields)
MySqlConnection _conn;
static string _connStr;

(in a method)
_connStr = "bladibla"; //correct string of course
_conn = new MySqlConnection(_connStr);
_conn.StateChange += CheckConnection;
_conn.Open();

When the connection is "Connecting" or "Open", the StateChange event is triggered.

But when I stop the MySQL server, I don't get any event for the state change. While the connection must be either broker or closed.

Is this a known issue? Or should I take care of this in another way? Google wasn't helpful with this specific issue.
kind regards,

Matthijs

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>