El operador '==' no se puede aplicar a operandos de tipo 'byte []' y 'string'
Estoy haciendo un programa con una página de inicio de sesión y este error apareció al codificarlo: Operador==
no se puede aplicar a operandos de tipobyte[]
ystring
No estoy seguro de dónde ir o cómo manejarlo. Esta es mi sección con el error:
private void button1_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBox1.Text))
{
MessageBox.Show("Please Enter your username.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
textBox1.Focus();
return;
}
try
{
using (DataEntities test = new DataEntities())
{
var query = from o in test.Users
where o.Username == textBox1.Text && o.Password == textBox2.Text
select o;
if(query.SingleOrDefault() != null)
{
MessageBox.Show("You have been successfully logged in.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
//Add your code process login here
}
else
{
MessageBox.Show("Your username or password is incorrect.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
¡Gracias por adelantado!