Exemplo n.º 1
0
        private void getTable(ref string table, ref DataTable dtem)
        {
            dtem = new DataTable();
            string cmd = "select * from " + table + " where 1=1 ";

            if (txtPID.Text != "")
            {
                cmd += "and plan_id = '" + txtPID.Text + "'";
            }
            if (txtPName.Text != "")
            {
                cmd += "and plan_name = '" + txtPName.Text + "'";
            }
            sql.datatable(cmd, ref dtem);
        }
Exemplo n.º 2
0
        public frmStt()
        {
            InitializeComponent();
            sto = Storage.getStorage();
            string table = sto.stt_tb;

            sql = new sqlfirst();
            dt  = new DataTable();
            string cmd = "select * from " + table;

            sql.datatable(cmd, ref dt);
            dgvStt.DataSource = dt;
            this.Height       = dgvStt.Rows.Count * 30;
            this.Width        = dgvStt.Columns.Count * 150;
        }