Answers for "mysql check if password is correct c#"

SQL
1

mysql check if password is correct c#

private bool IsValidUser(string userName, string passWord)

{
bool loginSuccessful = false;
 string sql = "SELECT* FROM  Login WHERE Username=@UserName AND [Password]=@Password'";

SqlCommand sqlCommand= new SqlCommand(sql, con);
sqlCommand.Parameters.Add(new SqlParameter("Name", userName));
sqlCommand.Parameters.Add(new SqlParameter("[Password]", passWord));
SqlDataReader rdr = mySQL.ExecuteReader();

if (rdr.HasrRows()) 
   loginSuccessful = true;

return loginSuccessful ;
}
Posted by: Guest on June-07-2020

Code answers related to "mysql check if password is correct c#"

Code answers related to "SQL"

Browse Popular Code Answers by Language