Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            st  = comboBox2.Text.ToString().Trim(); //dilei
            st1 = comboBox1.Text.ToString().Trim(); //diqu
            OleDbConnection  my_conn;
            OleDbDataAdapter my_adapter;
            DataSet          my_ds;
            C_conn           c1 = new C_conn();

            my_conn = c1.get_conn();
            string selectstr = "select 预测年份," + st + " from biao3 where 行政区 = '" + st1 + "'";

            my_adapter = new OleDbDataAdapter(selectstr, my_conn);
            my_ds      = new DataSet();
            my_adapter.Fill(my_ds, "biao3");
            dataGridView1.DataSource = my_ds.Tables["biao3"];
            my_conn.Close();

            showChart(ChartChartTypeEnum.chChartTypeColumnClustered);
        }
        private void comboBox2_S(object sender, EventArgs e)
        {
            int              m  = Convert.ToInt32(comboBox1.Text.ToString());
            string           st = comboBox2.Text.ToString().Trim();
            OleDbConnection  my_conn;
            OleDbDataAdapter my_adapter;
            DataSet          my_ds;
            C_conn           c1 = new C_conn();

            my_conn = c1.get_conn();
            string selectstr = "select 类型,建设用地,旱地,林地草地,河流,水库坑塘,水田,沼泽,滩涂,盐田及海水养殖场 from biao1 where 年份 = " + m + " and 行政区 = '" + st + "'";

            my_adapter = new OleDbDataAdapter(selectstr, my_conn);
            my_ds      = new DataSet();
            my_adapter.Fill(my_ds, "biao1");
            dataGridView1.DataSource = my_ds.Tables["biao1"];
            my_conn.Close();

            showChart(ChartChartTypeEnum.chChartTypeLine);
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            st  = comboBox2.Text.ToString().Trim();
            st1 = comboBox1.Text.ToString().Trim();
            OleDbConnection  my_conn;
            OleDbDataAdapter my_adapter;
            DataSet          my_ds;
            C_conn           c1 = new C_conn();

            my_conn = c1.get_conn();
            string selectstr = "select 类型,建设用地,旱地,林地草地,河流,水库坑塘,水田,沼泽,滩涂,盐田及海水养殖场 from biao2 where 类型 = '" + st1 + "' and 行政区 = '" + st + "'";

            my_adapter = new OleDbDataAdapter(selectstr, my_conn);
            my_ds      = new DataSet();
            my_adapter.Fill(my_ds, "biao2");
            dataGridView1.DataSource = my_ds.Tables["biao2"];
            my_conn.Close();

            showChart(ChartChartTypeEnum.chChartTypeColumnClustered);
        }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            int a2 = Convert.ToInt32(comboBox2.Text.ToString().Trim()); //nianfen

            st1 = comboBox1.Text.ToString().Trim();                     //diqu
            string           st3 = comboBox3.Text.ToString().Trim();    //dilei
            OleDbConnection  my_conn;
            OleDbDataAdapter my_adapter;
            DataSet          my_ds;
            C_conn           c1 = new C_conn();

            my_conn = c1.get_conn();
            string selectstr = "select 建设用地,旱地,林地草地,河流,水库坑塘,水田,沼泽,滩涂,盐田及海水养殖场 from biao3 where 预测年份 = " + a2 + " and 行政区 = '" + st1 + "'";

            my_adapter = new OleDbDataAdapter(selectstr, my_conn);
            my_ds      = new DataSet();
            my_adapter.Fill(my_ds, "biao3");
            dataGridView1.DataSource = my_ds.Tables["biao3"];
            my_conn.Close();

            showChart(ChartChartTypeEnum.chChartTypeColumnClustered);
        }
Ejemplo n.º 5
0
        private void Form2_Load(object sender, EventArgs e)
        {
            C_conn c1 = new C_conn();

            my_conn = c1.get_conn();
            string selectstr = "select * from 2000";

            my_adapter = new OleDbDataAdapter(selectstr, my_conn);
            my_ds      = new DataSet();
            my_adapter.Fill(my_ds, "2000");
            dataGridView1.DataSource = my_ds.Tables["2000"];
            my_conn.Close();

            this.listView1.View        = View.Details;
            this.listView1.GridLines   = true;
            this.listView1.HeaderStyle = ColumnHeaderStyle.Nonclickable;
            this.listView1.Columns.Add("行政区", 100, HorizontalAlignment.Right);
            this.listView1.Columns.Add("建设用地", 100, HorizontalAlignment.Right);
            this.listView1.Columns.Add("旱地", 110, HorizontalAlignment.Right);
            this.listView1.Columns.Add("林地草地", 100, HorizontalAlignment.Right);
            this.listView1.Columns.Add("水库坑塘", 100, HorizontalAlignment.Right);
            this.listView1.Columns.Add("水田", 100, HorizontalAlignment.Right);
            this.listView1.Columns.Add("河流", 100, HorizontalAlignment.Right);
            this.listView1.Columns.Add("沼泽", 100, HorizontalAlignment.Right);
            this.listView1.Columns.Add("滩涂", 100, HorizontalAlignment.Right);
            this.listView1.Columns.Add("盐田及海水养殖场", 110, HorizontalAlignment.Right);
            this.listView1.Visible = true;

            C_conn c2 = new C_conn();

            my_conn = c2.get_conn();
            string selectstr2 = "select * from change";

            my_adapter = new OleDbDataAdapter(selectstr2, my_conn);
            my_ds      = new DataSet();
            my_adapter.Fill(my_ds, "change");
            dataGridView2.DataSource = my_ds.Tables["change"];
            my_conn.Close();

            string strcom = comboBox2.Text.ToString().Trim();

            this.listView3.View        = View.Details;
            this.listView3.GridLines   = true;
            this.listView3.HeaderStyle = ColumnHeaderStyle.Nonclickable;
            this.listView3.Columns.Add(strcom, 100, HorizontalAlignment.Right);
            this.listView3.Columns.Add("建设用地", 100, HorizontalAlignment.Right);
            this.listView3.Columns.Add("旱地", 110, HorizontalAlignment.Right);
            this.listView3.Columns.Add("林地草地", 100, HorizontalAlignment.Right);
            this.listView3.Columns.Add("水库坑塘", 100, HorizontalAlignment.Right);
            this.listView3.Columns.Add("水田", 100, HorizontalAlignment.Right);
            this.listView3.Columns.Add("河流", 100, HorizontalAlignment.Right);
            this.listView3.Columns.Add("沼泽", 100, HorizontalAlignment.Right);
            this.listView3.Columns.Add("滩涂", 100, HorizontalAlignment.Right);
            this.listView3.Columns.Add("盐田及海水养殖场", 100, HorizontalAlignment.Right);
            this.listView3.Visible = true;

            this.listView4.View        = View.Details;
            this.listView4.GridLines   = true;
            this.listView4.HeaderStyle = ColumnHeaderStyle.Nonclickable;
            this.listView4.Columns.Add(Program.name, 100, HorizontalAlignment.Right);
            this.listView4.Columns.Add("建设用地", 100, HorizontalAlignment.Right);
            this.listView4.Columns.Add("旱地", 110, HorizontalAlignment.Right);
            this.listView4.Columns.Add("林地草地", 100, HorizontalAlignment.Right);
            this.listView4.Columns.Add("水库坑塘", 100, HorizontalAlignment.Right);
            this.listView4.Columns.Add("水田", 100, HorizontalAlignment.Right);
            this.listView4.Columns.Add("河流", 100, HorizontalAlignment.Right);
            this.listView4.Columns.Add("沼泽", 100, HorizontalAlignment.Right);
            this.listView4.Columns.Add("滩涂", 100, HorizontalAlignment.Right);
            this.listView4.Columns.Add("盐田及海水养殖场", 100, HorizontalAlignment.Right);
            this.listView4.Visible = true;

            C_conn c3 = new C_conn();

            my_conn = c3.get_conn();
            string selectst2 = "select * from 2009";

            my_adapter = new OleDbDataAdapter(selectst2, my_conn);
            my_ds      = new DataSet();
            my_adapter.Fill(my_ds, "2009");
            dataGridView3.DataSource = my_ds.Tables["2009"];
            my_conn.Close();

            this.listView5.View        = View.Details;
            this.listView5.GridLines   = true;
            this.listView5.HeaderStyle = ColumnHeaderStyle.Nonclickable;
            this.listView5.Columns.Add("行政区", 100, HorizontalAlignment.Right);
            this.listView5.Columns.Add("建设用地", 100, HorizontalAlignment.Right);
            this.listView5.Columns.Add("旱地", 110, HorizontalAlignment.Right);
            this.listView5.Columns.Add("林地草地", 100, HorizontalAlignment.Right);
            this.listView5.Columns.Add("水库坑塘", 100, HorizontalAlignment.Right);
            this.listView5.Columns.Add("水田", 100, HorizontalAlignment.Right);
            this.listView5.Columns.Add("河流", 100, HorizontalAlignment.Right);
            this.listView5.Columns.Add("沼泽", 100, HorizontalAlignment.Right);
            this.listView5.Columns.Add("滩涂", 100, HorizontalAlignment.Right);
            this.listView5.Columns.Add("盐田及海水养殖场", 110, HorizontalAlignment.Right);
            this.listView5.Visible = true;
        }