Open method: Connection unexpectedly terminated
Posted by: Anil Bhatia
Date: December 30, 2005 10:27AM

Hey,

I have just installed MySql 5.0.15 and Connector/net 1.0.7.

I am using c# and am just trying to connect to a remote database. The user is valid and I can connect using the console with no problems. However the Open method is producing the exception 'Connection unexpectedly terminated'. My code is as follows:

MySqlConnection dbConn;
string sConnectionString;
sConnectionString = "Database=db;Data Source=host;User Id=abc;Password=abc";
dbConn = new MySqlConnection(sConnectionString);
try
{
dbConn.Open();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}

I originally was using the Odbc Drivers and it was working fine, but wanted to upgrade to use Connector/net.

Anybody have any ideas?? Please help!

Thanks in advance,

Anil

Options: ReplyQuote




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.