"No se puede emitir un objeto del tipo 'System.Byte []' para escribir 'System.IConvertible'." Error en la foto: ¿por qué y cómo lo soluciono? [cerrado]
Mi código a continuación muestra el error "No se puede convertir el objeto del tipo 'System.Byte []' para escribir 'System.IConvertible'".
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (fpPhoto.HasFile)
{
if (fpPhoto.PostedFile.ContentType == "image/jpg"
|| fpPhoto.PostedFile.ContentType == "image/jpeg"
|| fpPhoto.PostedFile.ContentType == "image/png")
{
int filelenght = fpPhoto.PostedFile.ContentLength;
imagebytes = fpPhoto.FileBytes;
//fpPhoto.PostedFile.InputStream.Read(imagebytes, 0, filelenght);
}
}
User objUser = new User();
objUser.UserName_Pk = txtUserName.Text;
objUser.Password = txtPassword.Text;
objUser.MobileNo = txtMobileNo.Text;
objUser.Email = txtEmail.Text;
objUser.SecurityAnswer = txtAnswer.Text;
objUser.Photo = Convert.ToByte( imagebytes);
¿Por qué recibo este error y cómo puedo solucionarlo?