【发布时间】:2011-12-12 12:04:53
【问题描述】:
我正在从数据表中读取约会。这是我的代码:
List<MyClass> myObjects = (from e in myEntities.Mytable where
e.DateFrom >= schedulerInfo.ViewStart &&
e.DateTo <= schedulerInfo.ViewEnd
select e).ToList();
List<Appointment> appointments = new List<Appointment>(myObjects.Count);
foreach (MyClass e in myObjects) {
Appointment a = new Appointment();
a.ID = e.ID;
a.Subject = e.Description;
a.Start = e.DateFrom;
a.End = e.DateTo;
a.BackColor = System.Drawing.Color.Yellow;
appointments.Add(a);
当我运行它时,它不是黄色的!
【问题讨论】: