mardi 5 juillet 2016

A call to SSPI failed, see inner exception. SQL

After a lot of search on different forums I ask for help here.

I make a little app which require DB connection. It worked very good before when I was on Win 7 but now on Win 10 I have an Error : A call to SSPI failed, see inner exception.

Here is my code (I am sure of my connection data):

static string host_name  = "mysql-myname.alwaysdata.net";
static string database   = "myname_mydb";
static string user_name  = "myname";
static string password = "mypwd";

MySqlConnection c;

public DbManager()
{
    c = new MySqlConnection($"SERVER={host_name};DATABASE={database};UID={user_name};PWD={password};Integrated Security=false;");
}

private bool OpenConnection()
{
    {
        c.Open(); // <-- The error occurs here
        return true;
    }
    catch (Exception e)
    {
        Console.Write(e.Message);
        Console.Write(e.StackTrace);
        return false;
    }
}

Thanks in advance for your help.

Aucun commentaire:

Enregistrer un commentaire