private void DBView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { String[] sensordata = new String[14]; for (int i = 0; i < sensordata.Length; i++) { sensordata[i] = querydatatable.Tables[0].Rows[e.RowIndex][i].ToString(); } String[] devicedata = new String[3]; for (int i = 0; i < devicedata.Length; i++) { devicedata[i] = devicetable.Tables[0].Rows[Convert.ToInt32(sensordata[4]) - 1][i + 1].ToString(); } String[] operatordata = new String[5]; for (int i = 0; i < operatordata.Length; i++) { operatordata[i] = operatortable.Tables[0].Rows[Convert.ToInt32(sensordata[5]) - 1][i + 1].ToString(); } SensorDataViewer sdv = new SensorDataViewer(sensordata, operatordata, devicedata, sqlConnection); sdv.ShowDialog(); }
private void DBView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { String[] sensordata = new String[14]; for (int i = 0; i < sensordata.Length; i++) { sensordata[i] = querydatatable.Tables[0].Rows[e.RowIndex][i].ToString(); } String[] devicedata = new String[3]; for (int i = 0; i < devicedata.Length; i++) { devicedata[i] = devicetable.Tables[0].Rows[Convert.ToInt32(sensordata[4])-1][i+1].ToString(); } String[] operatordata = new String[5]; for (int i = 0; i < operatordata.Length; i++) { operatordata[i] = operatortable.Tables[0].Rows[Convert.ToInt32(sensordata[5])-1][i+1].ToString(); } SensorDataViewer sdv = new SensorDataViewer(sensordata,operatordata,devicedata,sqlConnection); sdv.ShowDialog(); }