日期:2014-05-20  浏览次数:21182 次

linq 数据库读取问题!!
本帖最后由 wayne_lu 于 2012-04-21 22:11:10 编辑
                     var query = from a in database.T_ExpressRecord
                                                join b in database.T_ExpressRecordContext
                                                on a.RecordID equals b.RecordID
                                                where a.ExpressID == ecompany.ExpressID && a.Number.Trim().ToUpper() == number.Trim().ToUpper()
                                                orderby b.Time descending
                                                select new { Context = b.Context, Time = b.Time };

                                    if (query != null && query.Count() > 0)
                                    {
                                        expressList = new List<ExpressDelivery>();

                                        foreach (var q in query)
                                        {
                                            expressList.Add(new ExpressDelivery()
                                            {