コード例 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            dbconnect dbcon = new dbconnect();

            String loc  = (String)comboBox2.SelectedItem;
            String qry3 = "SELECT * from inventory_fd where location='" + loc + "' ";

            BindingSource bsource = new BindingSource();

            bsource.DataSource = dbcon.ReadValue(qry3);

            dataGridView2.DataSource = bsource;
        }
コード例 #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            String stadate = dateTimePicker1.Text;
            String enddate = dateTimePicker2.Text;
            String loc     = (String)comboBox4.SelectedItem;
            String typ     = (String)comboBox3.SelectedItem;

            dbconnect dbcon = new dbconnect();

            String qry1 = "SELECT * FROM fd_trans WHERE location='" + loc + "' AND type='" + typ + "' AND Date BETWEEN '" + stadate + "' AND '" + enddate + "' ";

            BindingSource bsource = new BindingSource();

            bsource.DataSource       = dbcon.ReadValue(qry1);
            dataGridView3.DataSource = bsource;
        }