
05/08/2009, 02:09
|
| | Fecha de Ingreso: mayo-2009
Mensajes: 118
Antigüedad: 15 años, 9 meses Puntos: 1 | |
Respuesta: Por que este error en el Execute.Scalar()? Hola !!
Pues me sigue dando error en el executescalar() y el error que me da es este
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1130' at line 1
Y la sentencia de MySql que tengo la hago asi
Codigo = textBox2.Text.Trim();
cmd = new MySqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select unds from " + Codigo;
conn.Open();
Object Valor = null;
Valor = cmd.ExecuteScalar();
resultado = 20 * unds;
if(Valor.ToString().Trim() != "")
{
if (resultado >= int.Parse(Valor.ToString().Trim()))
{
}
}
}
}
} |