protected void bind_tpdata() //顯示對應TP值 { string sql_stm = ""; DataTable dt = new DataTable(); sql_stm = "SELECT tp, tp_val FROM l8bi0.l8b_ary_spc_ttp_tp_value WHERE csv_name = '" + Request["csv_name"] + "' "; mycon = new MySqlConnection(System.Configuration.ConfigurationSettings.AppSettings["L8BI0_MySQL"]); mycon.Open(); myada = new MySqlDataAdapter(sql_stm, mycon); myada.Fill(dt); mycon.Close(); TP_Data.DataSource = dt; TP_Data.DataBind(); for (int i = 0; i < dt.Rows.Count; i++) { string tp_val = TP_Data.Rows[i].Cells[1].Text; float tp = float.Parse(tp_val); if (tp > -4.5 || tp < -11.5) { TP_Data.Rows[i].Cells[1].BackColor = System.Drawing.Color.Pink; } } }
private void gv_UserList_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { if (gv_UserList.SelectedRows.Count != 0) { fd_username.Text = gv_UserList.SelectedRows[0].Cells["UserName"].Value.ToString(); TC_Main.SelectedTab = TP_Data; TP_Data.Show(); Btn_Load_Click(null, null); } }