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

两个表查询语句
moss里的两个表查询语句,刚开始学,对moss的查询不是很了解
  SPList listPro = Common.ApproveProblem;
  SPList liCard = Common.ApproveCard;
  SPListItemCollection pro = listPro.Items;
  SPListItemCollection card = liCard.Items;
  if (pro.Count > 0)
  {
  IEnumerable<SPListItem> Cardlitems = card.Cast<SPListItem>();
  IEnumerable<SPListItem> Prolitems = pro.Cast<SPListItem>();
  var r = from item in Cardlitems
  from itemm in Prolitems
  where Convert.ToString(itemm["CardId"]) == Convert.ToString(item["CardId"])
  || Convert.ToString(item["CorrectState"])==
approveCard.CorrectState)
  orderby item["ApproveDate"]
  select item;
  }

------解决方案--------------------
你想问什么?
你的问题是什么
------解决方案--------------------
搂主写的不是挺好的吗

------解决方案--------------------
moss.