본문 바로가기
C#

LinQ

by 캡틴노랑이 2015. 8. 26.
반응형

List

lnq = (from c in Competitor
      where c.FS_STARTER_VALUE == "Y"
       select c);  

--------------------------------------------------------------------------------------

 

DaTable

var dtCnt1 = (from row in dtPrintCnt1.AsEnumerable()

              where row.Field<string>("CD") == changeDt.Rows[i]["_CD1"].x_AsString() 

                 && row.Field<string>("RPT") != changeDt.Rows[i]["Cnt1"].x_AsString()

             select row);

 

 

bindTable.AsEnumerable()

.GroupBy(r => new { Col1 = r["SAMPLENO"], Col2 = r["HOSNO"], Col3 = r["REQDTE"], Col4 = r["PATNM"] })

//.Where(row => row.Key.Col2.ToString() == HOSNO && row.Key.Col3.ToString() == REQDTE && row.Key.Col4.ToString() == PATNM && row.Count() > 1)

.Select(row => row.First()).CopyToDataTable()

;


반응형

댓글