In a table I have the CM1_CUENTA field where a user can have many accounts but I need to know if among all of them exists the numbers 2365xxxx or 53152001 to perform an action and if none exists, perform another action.
consulta2 = "SELECT * FROM TCMOVIMIENTOCONTABLE WHERE CM1_TERCERO LIKE '%" + TBNit.Text + "' AND CM1_TIPO = '" + comboBoxTipo.Text + "' AND CM1_NUM LIKE '%" + TBCausacion.Text + "'";
if (lector.Read())
{
cuenta1 = lector["CM1_CUENTA"].ToString();
//textBox4.Text = cuenta1;
if (int.Parse(cuenta1) == 2365)
{
//MessageBox.Show("Existe 1");
TBRete.Text = lector["CM1_VALORH"].ToString();
}
else if (int.Parse(cuenta1) == 53152001)
{
//MessageBox.Show("Existe 2");
TBRetenAsum.Text = lector["CM1_VALORD"].ToString();
}
else
{
TBTotal1.Text = lector["CM1_VALORH"].ToString();
}
}
my requirement would be like bringing a variable "account1" if it finds the 2365xxx or 53152001 to perform the action and if it is not in any account simply save a value in a textbox. the value 2365 normally comes "23659999" so the first 4 numbers are what I need in the case of 2365