MySql connection security permission error

Discussion in 'Site Programming, Development and Design' started by Morph3y, Jan 10, 2012.

  1. Hello,
    I am getting this MySql error:

    http://alexdenysenko.com/dev/

    What i am trying to do is opening connection and trying to execute a query (it was CREATE but whatever is not working).
    So here's a peace of code:

    MySqlConnection conn = new MySqlConnection(_connString);
    MySqlCommand cmd = new MySqlCommand(query, conn);
    conn.Open();
    try
    {
    cmd.ExecuteNonQuery();
    return "true";
    }
    catch (Exception ex)
    {
    return ex.Message;
    }
    finally
    {
    conn.Close();
    }

    Help me cuz I am starting to think i am missing smth very simple.
     
  2. rum

    rum Winhost Staff

    The error "The application attempted to perform an operation not allowed by the security policy" you are getting suggests that you are running into this error probably because of the insufficient trust level. By default the trust level is set to medium, but your application may require the full trust. Please see this following Knowledge Base article for the instructions on how to change the trust level.
     
    Last edited by a moderator: Oct 14, 2015

Share This Page