(Linq) Linq to DataSet

C#/Winform 2017. 4. 14. 11:55
728x90

DataTable dt = new DataTable();
dt.Columns.Add("name");
dt.Columns.Add("age");
dt.Columns.Add("birth");

dt.Rows.Add("강준", "35", "1980.09.18");
dt.Rows.Add("이가영", "35", "1980.10.13");
dt.Rows.Add("강하담", "1", "2014.04.10");

 

var selectData = dt.AsEnumerable().Where(c => c.Field<string>("name") == "강준")
                                                  .Select(c => new { Name = c.Field<string>("name"),

                                                                                Age = c.Field<string>("Age"),

                                                                               Birth = c.Field<string>("birth") }); 

728x90

'C# > Winform' 카테고리의 다른 글

(Linq) Cross Join  (0) 2017.04.14
(Linq) linq - join into  (0) 2017.04.14
(Linq) linq to xml  (0) 2017.04.14
(Linq) linq T Type Join result T Type  (0) 2017.04.14
(WPF) wpf 관련 리소스 정리  (0) 2017.04.13
Posted by kjun.kr
,