FairyBusiness
asked on
Help with my C# error?
Hi, I am getting this error on my page:
Does anyone know what this means?
Login:
http://auroriella.com/user.aspx
No mapping exists from object type System.Web.UI.WebControls. TextBox to a known managed provider native type.
protected void LogIn(object send, EventArgs e)
{
userEmail = loginEmail.Text.Trim();
userPassword = loginPassword.Text.Trim();
hashPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(userPassword, "sha1");
//Response.Write(string.Format("<script type='text/javascript'>alert('login');</script>"));
using (SqlConnection con = new SqlConnection(connectionString))
{
con.Open();
// build the sql query
query = "SELECT id, FirstName FROM Users WHERE Email = @email AND Password = @hashPassword LIMIT 1";
// create the command object
SqlCommand cmd = new SqlCommand(query, con);
// parameters to protect from sql injection
cmd.Parameters.AddWithValue("@email", email);
cmd.Parameters.AddWithValue("@hashPassword", hashPassword);
// execute the query
cmd.ExecuteNonQuery();
//Response.Write(string.Format("<script type='text/javascript'>alert('{0}');</script>", cmd));
if (cmd.ExecuteNonQuery() > 0)
{
completion succeededHeader = new completion("Success!");
succeededHeader.message(this.success);
completion succeeded = new completion("Login credentials verified.");
succeeded.message(this.success);
}
else
{
errors failHeader = new errors("Error:");
errors fail = new errors("The username or password you entered was incorrect.<br />Please make sure your caps lock key is off and try again.");
failHeader.message(this.error);
fail.message(this.error);
}
} // end using SqlConnection
} // end LogIn method
Does anyone know what this means?
Login:
http://auroriella.com/user.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks