MySQL connector problem
Hola!Nu har jeg misbrugt en halv weekend på at få det her til at fungere (halvdelen af tiden på MySQL's hjemmeside);
{
MySqlConnection myConnection = new MySqlConnection();
myConnection.ConnectionString = "Persist Security Info=False;database=movedb;server=localhost;Connect Timeout=30;user id=root; pwd=********";
myConnection.Open();
}
Jeg får nedenstående fejl;
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at MySql.Data.MySqlClient.NativeDriver.get_SupportsBatch()
at MySql.Data.MySqlClient.Statement.TokenizeSql(String sql)
at MySql.Data.MySqlClient.Statement.BindParameters()
at MySql.Data.MySqlClient.PreparableStatement.Execute(MySqlParameterCollection parameters)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
at MySql.Data.MySqlClient.Driver.Configure(MySqlConnection connection)
at MySql.Data.MySqlClient.NativeDriver.Configure(MySqlConnection connection)
at MySql.Data.MySqlClient.MySqlConnection.Open()
at ConsoleApplication1.Program.Main(String[] args)
MySQL.dll er tilføjet under "references" i VS2005 IDE'en.
Jeg har ingen problemer med at forbinde til databasen hvis jeg bruger System.Data.Odbc, men jeg vil hellere bruge Connectoren af hensyn til hastigheden og jeg slipper for at oprette DSN på klient maskinerne.
// Høygaard
