PeriodNo StartTime EndTime 1 09:00 10:00 2 10:01 11:00 3 11:10 12:10 4 12:11 01:10 5 02:01 03:00 6 03:01 04:00 L 01:11 02:00
Working_date working_day 2013-04-22 Monday 2013-04-23 Tuesday 2013-04-25 Thursday 2013-04-26 Friday
DataTable result= userdao.getdateanddayfortimetable1(comp); DataTable period = userdao.getperiodfortimetable(); int periodcount = period.Rows.Count; int daycount = result.Rows.Count; DataTable dt = new DataTable(); for (int i = 0; i < periodcount; i++) { dt.Columns.Add(); } for (int j = 0; j < daycount; j++) { dt.Rows.Add(); } //System.Windows.Forms.DataGridView grid = new System.Windows.Forms.DataGridView(); PLayer.GenerateTimetable gt = new PLayer.GenerateTimetable(); // gt.dataGridView1.DataSource = dt; for (int k = 0; k < periodcount; k++) { //gt.dataGridView1.Columns[k].HeaderText dt.Columns[k].ColumnName= period.Rows[k]["PeriodNo"].ToString()+"(" + period.Rows[k]["StartTime"].ToString() +"-"+ period.Rows[k]["EndTime"].ToString() + ")"; } gt.dataGridView1.DataSource = dt; for (int m = 0; m < daycount; m++) { gt.dataGridView1.Rows[m].HeaderCell.Value = result.Rows[m]["Working_day"].ToString(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)