Strange connection failure (beta 1.0, .NET 1.1)
Posted by:
Ian Z
Date: October 22, 2004 04:53AM
Upon installing the Connector .NET client on my system (Windows XP Pro, MDAC 2.8, .NET 1.1, Connector .NET beta 1.0 using the .NET 1.1 version of the connector) I found that after updating my library references, my application wouldn't connect to the database. I was building a winforms app and no application-level exceptions were thrown, so I added some try/catch blocks around the instantiation of my MySqlConnection object. The try/catch didn't catch any MySqlExceptions. After several hours I decided to try to get it working an a test application that I build from scratch. Here's the source:
namespace test
{
using System;
using MySql.Data.MySqlClient;
public class Test
{
static void Main(string[] args)
{
Console.Write("STARTING");
string connectionString = "DataSource=xx.xx.xx.xx;Database=xx;Username=xx;Password=xx";
MySqlConnection connection1 = new MySqlConnection(connectionString);
connection1.Open();
connection1.Close();
Console.Write("ENDING");
}
}
}
Obviously, I had to hide the connection string, but I've simply replaced all characters with x's.
My compile command line is as follows:
csc /r:".\bin\MySql.Data.dll" test.cs
I've put the MySql client into a \bin\ folder in my application directory. The compile executes without problem. Just to note, this test application is a simple console app while my main application was a winforms app.
When I run the application from the console I get a "Common Language Runtime Debugging Services" dialog popping up saying "application has generated an exception that could not be handled".
Am I doing something wrong here? Could it be that I need to somehow force the compiler to deal in .NET 1.1 mode or something? I'm stumpped.
Subject
Written By
Posted
Strange connection failure (beta 1.0, .NET 1.1)
October 22, 2004 04:53AM
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.