void impostaarticolo() { Caricamento carica = new Caricamento(); carica.Show(); Application.DoEvents(); iDB2Connection DBCONN = new iDB2Connection(Program.myConnString); DBCONN.Open(); iDB2Command myCommand = new iDB2Command(); myCommand.Connection = DBCONN; myCommand.CommandText = "SELECT ararti, ardsar" + " FROM $emiedati.art00f a " + " order by ardsar"; iDB2DataReader myReader = myCommand.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(myReader); CMB_Articolo.DataSource = dt; CMB_Articolo.DisplayMember = "ardsar"; CMB_Articolo.ValueMember = "ararti"; carica.Close(); DBCONN.Close(); }
private void SceltaFornitore_Load(object sender, EventArgs e) { Caricamento carica = new Caricamento(); carica.Show(); Application.DoEvents(); iDB2Connection DBCONN = new iDB2Connection(Program.myConnString); DBCONN.Open(); iDB2Command myCommand = new iDB2Command(); myCommand.Connection = DBCONN; myCommand.CommandText = "SELECT acscon, acrag1" + " FROM $d_emil.acf00f a " + " where actpcd = 'F'" + " order by acrag1"; iDB2DataReader myReader = myCommand.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(myReader); Cmb_Fornitore.DataSource = dt; Cmb_Fornitore.DisplayMember = "acrag1"; Cmb_Fornitore.ValueMember = "acscon"; carica.Close(); DBCONN.Close(); //primo numero libero lbl_ordine.Text = Convert.ToString(PrimoNumeroLibero() + 1); }