日期:2014-05-20 浏览次数:20889 次
SELECT TOP 1000 [ID] ,[AssetID] ,[DistributeTo] ,[DistributeTime] ,[DistributeUse] ,[Remark] ,[OperUser] ,[DistributeToDepart] FROM [Asset].[dbo].[AM_AssetDistributionInfo] where AssetID not in (select AssetID from AM_AssetWasteInfo) and AssetID='2011205070013'
var query= (from t1 in AM_AssetDistributionInfo where !(from t2 in AM_AssetWasteInfo select AssetID).Contains(AssetID) && AssetID=='2011205070013' select new{t1.AssetID,t1.DistributeTo,t1.DistributeUse}).Take(1000); query.ToList();
------解决方案--------------------
var query= db.v_AssetYes.Where<v_AssetYes>(expr).OrderBy(p => p.cdepname).ThenBy(p => p.cpsn_name);
PagedList<v_AssetYes> model=query.Where(p=>!(db.AM_AssetWasteInfo.Select(q=>q.AssetID)).Contains(p.AssetID )).ToPagedList(id ?? 1, 12);
var sss = model.ToList();