protected void RefreshSchedules() { ServiceInterface server = new ServiceInterface(); List<WebSchedule> scheds = server.GetAllSchedules(); DataTable dt = new DataTable(); dt.Columns.Add("startTime", typeof(string)); dt.Columns.Add("endTime", typeof(string)); dt.Columns.Add("channel", typeof(string)); dt.Columns.Add("title", typeof(string)); dt.Columns.Add("type", typeof(string)); dt.Columns.Add("idSchedule", typeof(int)); foreach (WebSchedule s in scheds) { DataRow row = dt.NewRow(); row["startTime"] = s.startTime.ToString(); row["endTime"] = s.endTime.ToString(); row["channel"] = s.channelName; row["title"] = s.programName; row["type"] = s.scheduleTypeStr; row["idSchedule"] = s.idSchedule; dt.Rows.Add(row); } gridSchedules.DataSource = dt; gridSchedules.DataBind(); }