locked
Unable to Initialize Provider. Missing or incorrect Schema RRS feed

  • Question

  • User-1785554541 posted

    Hello Friends

    I am trying to implement a super simple MySQL membership. All I want my Membership class to do is ValidateUser. Here is my method:

    public override bool ValidateUser(string username, string password)
            {
                string CommandText = "SELECT FName, LName FROM `" + tableName + "`" + " WHERE Email = ?username AND Password = ?password";
    
                OdbcConnection conn = new OdbcConnection(connectionString);
                OdbcCommand cmd = new OdbcCommand(CommandText, conn);
    
                cmd.Parameters.Add("?username", OdbcType.VarChar, 255).Value = username;
                cmd.Parameters.Add("?password", OdbcType.VarChar, 255).Value = password;
    
                OdbcDataReader reader = null; // new MySQL reader object and set it to null.
    
                try
                {
                    conn.Open(); // Open the Connection to the Server
    
                    reader = cmd.ExecuteReader(CommandBehavior.SingleRow);
    
                    if (reader.HasRows) // If row with them login Credentials exists
                    {
                        return true; // Then return True, cause login must have been a success
                    }
                    else
                    {
                        return false; // Otherwise return False
                    }
                    reader.Close(); // Close the Reader object.
                } catch {
                    return false;
                }
            }

    When I try loggin in, I get the following error:

    I have added the MySQL.Web and MySQL.Data references. I also have auto generate schema set true. What am I doing wrong ?

    Here is my Users table (created by myself), where the user login details are saved:

    I would greatly appreciate any help.

    Thank You.

    Monday, March 28, 2011 2:11 PM

All replies