Hello,Please can someone help me,am trying to create login with MySQL database.Am having this error-"Access denied for user 'root'@'localhost'(using password:YES)"
These are my code on the front end-
try
{
string myConnection = "datasource=localhost;port=3306;username=root;password=root";
MySqlConnection myConn = new MySqlConnection(myConnection);
MySqlCommand SelectCommand = new MySqlCommand("select * from jedo.tbllogin where userid='" + this.texUname.Text + "' and password='" + this.textPword.Text + "';", myConn);
MySqlDataReader myReader;
myConn.Open();
myReader = SelectCommand.ExecuteReader();
int count = 0;
while (myReader.Read())
{
count = count + 1;
}
if (count == 1)
{
MessageBox.Show("Username and password is correct");
}
else if (count > 1)
{
MessageBox.Show("Duplicate Username and password...Access denied");
}
else
MessageBox.Show("Username and password is not correct...Please try again");
myConn.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
At the back end.
"
"