mardi 13 août 2019

Display into textbox using if sentence

I'm displaying some data from the database into textboxes on my windows form and I have to add something else but it depends on the account type (that information is saved on my Databse). Meaning it is either DM (domestic) or CM(comercial). I want for it to charge an extra amount if it's CM. I would appreciate any help, thank you.





OracleDataReader myReader = null;
            OracleCommand myCommand = new OracleCommand("SELECT SUM(IMPORTE) AS corriente FROM MOVIMIENTOS WHERE CUENTA='"+txtIngreseCuenta3.Text + "'AND CONCEPTO=10", connectionString);

            myReader = myCommand.ExecuteReader();

            while (myReader.Read())
            {

                txtCorriente.Text = (myReader["corriente"].ToString());


            }



I'm using this code to display into the textbox but I want it to get the account type from another table and IF it's CM then add a certain amount into a textbox.

Aucun commentaire:

Enregistrer un commentaire