[Mono-list] MySQL Connector

Florian Hester florian at nedlinux.nl
Sun Jul 16 13:53:58 EDT 2006


Hello,

I am using the MySql Connecter for .NET to connect to the MySql server.
But i am keep getting the following error:

Unhandled Exception: System.Net.Sockets.SocketException: The socket is not
connected

This is the code:

using System;
using System.Data;
using MySql.Data.MySqlClient;

class test
{
    public static void Main (string[] args)
    {
        MySqlConnection conn = new
MySqlConnection("server=localhost;database=...;uid=...;password=...");
        conn.Open();
        conn.Close();
    }
}

The error happens when opening the MySql connection.

The server is located on the same computer on Linux. I have tried to
connect to MySql with PHP which worked. I have tried gmcs and mcs
compilers, but no difference.

Can anyone help me?

Florian



More information about the Mono-list mailing list