Esempio n. 1
0
//        private clsMysqlConexion objmysql;

        private void btBuscar_Click(object sender, EventArgs e)
        {
            clsMysqlConexion objmysql  = new clsMysqlConexion();
            String           atributos = "fechayhora,id_linea,id_tarjeta,credito";
            String           cdgo_t    = (CBOX1.Checked) ? tbcdgo.Text : "";
            DataTable        dt        = objmysql.BuscarActividadTbl(atributos, dtinicio, dtfinal, cdgo_t, rbt1.Checked, rbt2.Checked);

            DataRow[] dr       = dt.Select();
            decimal   fltTotal = 0;

            for (int i = 0; i < dr.Length; i++)
            {
                fltTotal += Convert.ToDecimal(dr[i]["credito"]);
            }
            TBOX1.Text = fltTotal.ToString();

            dtgv.DataSource = dt;
        }