コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string date = DateTime.Now.ToString();

            DataSet ds  = new DataSet();
            string  sql = "select * from Newlab where Date = '" + Convert.ToDateTime(date) + "'";

            ds = ADOHelp.QueryDataSet(sql);
            if (ds.Tables.Count != 0)
            {
                TextBox1.Text  = ds.Tables[0].Rows[0][2].ToString();
                TextBox2.Text  = ds.Tables[0].Rows[0][3].ToString();
                TextBox15.Text = ds.Tables[0].Rows[0][4].ToString();
                TextBox16.Text = ds.Tables[0].Rows[0][5].ToString();
                TextBox29.Text = ds.Tables[0].Rows[0][6].ToString();

                TextBox3.Text  = ds.Tables[0].Rows[1][2].ToString();
                TextBox4.Text  = ds.Tables[0].Rows[1][3].ToString();
                TextBox17.Text = ds.Tables[0].Rows[1][4].ToString();
                TextBox18.Text = ds.Tables[0].Rows[1][5].ToString();
                TextBox30.Text = ds.Tables[0].Rows[1][6].ToString();

                TextBox5.Text  = ds.Tables[0].Rows[2][2].ToString();
                TextBox6.Text  = ds.Tables[0].Rows[2][3].ToString();
                TextBox19.Text = ds.Tables[0].Rows[2][4].ToString();
                TextBox20.Text = ds.Tables[0].Rows[2][5].ToString();
                TextBox31.Text = ds.Tables[0].Rows[2][6].ToString();

                TextBox7.Text  = ds.Tables[0].Rows[3][2].ToString();
                TextBox8.Text  = ds.Tables[0].Rows[3][3].ToString();
                TextBox21.Text = ds.Tables[0].Rows[3][4].ToString();
                TextBox22.Text = ds.Tables[0].Rows[3][5].ToString();
                TextBox32.Text = ds.Tables[0].Rows[3][6].ToString();

                TextBox9.Text  = ds.Tables[0].Rows[4][2].ToString();
                TextBox10.Text = ds.Tables[0].Rows[4][3].ToString();
                TextBox23.Text = ds.Tables[0].Rows[4][4].ToString();
                TextBox24.Text = ds.Tables[0].Rows[4][5].ToString();
                TextBox33.Text = ds.Tables[0].Rows[4][6].ToString();

                TextBox11.Text = ds.Tables[0].Rows[5][2].ToString();
                TextBox12.Text = ds.Tables[0].Rows[5][3].ToString();
                TextBox25.Text = ds.Tables[0].Rows[5][4].ToString();
                TextBox26.Text = ds.Tables[0].Rows[5][5].ToString();
                TextBox34.Text = ds.Tables[0].Rows[5][6].ToString();

                TextBox13.Text = ds.Tables[0].Rows[6][2].ToString();
                TextBox14.Text = ds.Tables[0].Rows[6][3].ToString();
                TextBox27.Text = ds.Tables[0].Rows[6][4].ToString();
                TextBox28.Text = ds.Tables[0].Rows[6][5].ToString();
                TextBox35.Text = ds.Tables[0].Rows[6][6].ToString();
            }
        }