只要是对像的都获取不到值是怎么回事?
var s = from vs in r.Datas where vs.DataTime >= start1 &&vs.DataTime<=end && vs.Property.ZDistance == szd select new Sysnet.QiandaoLake.Models.MonitorValue {Item=vs.Item,Station=vs.Station,Property=vs.Property,Value=vs.Value,DataTime=vs.DataTime};
int i = 1;
foreach (var itemm in s)
{
Sysnet.QiandaoLake.Models.MonitorValue models = new Sysnet.QiandaoLake.Models.MonitorValue();
models.id = i;
models.Item = itemm.Item;
models.Property =itemm.Property;
models.Station = itemm.Station;
models.Value = itemm.Value;
models.DataTime = itemm.DataTime;
i++;
list.Add(models);
}
//list转成DataTable
DataTable dt = ToDataTable(list);
在dataTable只能获取到这同个值。
------解决方案--------------------
我要分,我是弟弟