Ejemplo n.º 1
0
        void loadToComboBox(string par1, string par2, SqlDbType type, string procedureName, string displayMember, string valueMember, ComboBox comoBoxName)
        {
            SqlParameter[] array =
            {
                new SqlParameter(par1, type)
                {
                    Value = par2
                },
            };
            var cmd = db.cmd(procedureName, array);


            var dt = db.returnDataTable(cmd);

            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds, procedureName);

            comoBoxName.DataSource    = ds.Tables[procedureName];
            comoBoxName.DisplayMember = displayMember;
            comoBoxName.ValueMember   = valueMember;



            //SqlParameter[] array = {
            //            new SqlParameter("@companyId", SqlDbType.Int) { Value = companyId },
            //        };
            //var cmd = db.cmd("selectProductsForSpecificCompany", array);


            //var dt = db.returnDataTable(cmd);

            //SqlDataAdapter da = new SqlDataAdapter(cmd);
            //DataSet ds = new DataSet();
            //da.Fill(ds, "selectProductsForSpecificCompany");

            //productCombo.DataSource = ds.Tables["selectProductsForSpecificCompany"];
            //productCombo.DisplayMember = "productName";
            //productCombo.ValueMember = "productName";

            //refreshDataGridView();
        }
        public void refreshDataGridView()
        {
            SqlParameter[] array =
            {
                new SqlParameter("@role", SqlDbType.NVarChar)
                {
                    Value = noaaCombo.SelectedItem
                },
            };
            var cmd = db.cmd("selectPerson", array);
            var dt  = db.returnDataTable(cmd);

            dataGridView1.DataSource = dt;
        }
Ejemplo n.º 3
0
        public void refreshDataGridView()
        {
            SqlParameter[] array =
            {
                new SqlParameter("@companyId", SqlDbType.Int)
                {
                    Value = companyId
                },
            };
            var cmd = db.cmd("selectAllCompanyReciepts", array);

            var dt = db.returnDataTable(cmd);

            dataGridView1.DataSource = dt;
        }
Ejemplo n.º 4
0
        public void refreshDataGridView()
        {
            SqlParameter[] array =
            {
                new SqlParameter("@companyId", SqlDbType.Int)
                {
                    Value = companyId
                },
            };
            var cmd = db.cmd("selectProductsForSpecificCompany", array);

            var dt = db.returnDataTable(cmd);

            dataGridView1.DataSource = dt;

            //DataTable dt = new DataTable();
            //db.openConnection();
            //dt.Load(cmd.ExecuteReader());
            //db.closeConnection();
            //dataGridView1.DataSource = dt;
        }