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

指定的 LINQ 表达式包含对与不同上下文关联的查询的引用
先贴代码

var pb = from d in pr.Purchases join b in br.Books
                                           on d.bookID equals b.bookID
                                           where d.pUserID == userID && d.sta != "2"
                                           orderby d.pTime descending
                                           select new PurchaseBook {
                                               pID = d.pID, 
                                               bookID = d.bookID,
                                               bookName = d.bookName,
                                               pUserID = d.pUserID,
                                               pUserName = d.pUserName,
                                               sta = d.sta,
                                               pTime = d.pTime,
                                               ZT = d.ZT,
                                               sUserID = d.sUserID,