Can't connect to MySql database from server using Devart

Posted by annelie on Stack Overflow See other posts from Stack Overflow or by annelie
Published on 2010-05-19T18:34:15Z Indexed on 2010/05/20 10:50 UTC
Read the original article Hit count: 324

Filed under:
|
|
|

Hello,

I'm having trouble connecting to a MySql database from a server. I'm using Devart to connect, and I'm not sure if I need to do something more than to simply reference the dlls. When I started working on this project it was referencing the CoreLabs dlls, which if I've understood is the previous name for Devart. That didn't work, so I downloaded the new Devart dlls instead.

It works on my local machine, but when uploading to the server it crashes. I made a tiny console app to test the connection, and it fails when initialising, before I've even assigned a host etc.

Do I need to do anything more than just upload my .exe file to the server?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Devart.Data;
using Devart.Data.MySql;

namespace TestDatabaseConnection
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("about to connect");

            ConnectToDatabase();

            Console.ReadLine();
        }

        public static void ConnectToDatabase()
        {
            MySqlConnection connection = new MySqlConnection();
        }
    }
}

UPDATE: I can't see what the error is, I had a try catch around MySqlConnection connection = new MySqlConnection(); but no exception is thrown, it just crashes.

Thanks,

Annelie

© Stack Overflow or respective owner

Related posts about c#

Related posts about mysql