public bool CheckEmailExistance(string email) { string query = "SELECT users.email FROM users WHERE users.email = '" + email + "'"; using var connection = MySqlFactory.CreateConnection(); connection.Open(); var command = MySqlFactory.CreateCommand(query, connection); command.ExecuteNonQuery(); var dataTable = new DataTable(); var adapter = MySqlFactory.CreateDataAdapter(command); adapter.Fill(dataTable); return(dataTable.Rows.Count == 1); }