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

.open() not throwing exception.... (no replies)

$
0
0
I have a C# console application that connects to a remote MySQL dB via the V6.7.4.0 MySQL Connector/Net. This AM the ISP at the remote dB host's has been having issues and has been up and down over the last 80 to 90 minutes. I took this as an opportunity to tighten up the error handling in my code. After working with it for a while, I got a debugger pop up with the line "conDatabase.Open();" highlighted as shown in the following code snip:

try
{
conDatabase = new MySqlConnection( conString );
// do a test open so we know the server is up and running....
conDatabase.Open();
dBConnected = true;
}
catch (MySqlException errorMsg)
{
Console.WriteLine( "Database Error: " + errorMsg.Message);
Logger( errorMsg.Message, '1', true);
}


Why didn't this go into the catch block?

Thank you!

Viewing all articles
Browse latest Browse all 1451

Trending Articles



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