熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> SQL語言 >> 正文

LINQ 實現常見SQL查詢

2022-06-13   來源: SQL語言 

  Top 查詢skip(index)Take(count)

  var Results = from dt in ctxCustomersSkip()Take()
  select new
  {
  dtCustomerID
  dtCompanyName
  dtCity
  };

  Like 查詢startwith()

  from dt in ctxCustomers
  where dtIDStartwith(A)

  In查詢Contain()

  string[] s = { ivanaaaaaaa};
  var Results = from dt in ctxCustomersSkip()Take()
  where sContains(dtCustomerID)
  select new
  {
  dtCustomerID
  dtCompanyName
  dtCity
  };


From:http://tw.wingwit.com/Article/program/SQL/201311/16418.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.