<connection>.open() not throwing exception....
Posted by: Clay Goss
Date: November 18, 2013 09:48AM

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!

Options: ReplyQuote


Subject
Written By
Posted
<connection>.open() not throwing exception....
November 18, 2013 09:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.