Error 'System.Collections.Generic.Keynotfoundexception' occurred in mscorlib.dll

Asked

Viewed 164 times

-1

I created an application in visual studio 2017, I formatted the pc and installed the 2019 version and since then no application I try to connect to the database works.

always appears this error:

 An unhandled exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in mscorlib.dll

Additional information: A chave fornecida não estava presente no dicionário.

always of the error in this excerpt:

   string cnx = "server=localhost;user=root;password=;database=ERP;";
   try
   {
        MySqlConnection conexao = new MySqlConnection(cnx);
        conexao.Open();
        MessageBox.Show("oi eu estou aberto");
    }
    catch(Exception erro)
    {
        MessageBox.Show(erro.Message);
    }

I also tried to use in visual studio 2015 and nothing..

1 answer

0

Problem solved, I was using shaman I do not know what could have gone wrong with it since I never had problems.

I switched to wamp and started working again

Browser other questions tagged

You are not signed in. Login or sign up in order to post.