티스토리 뷰

WPF

DataTable Find Value - Lambda

NicSub 2020. 3. 30. 17:32
728x90
반응형


int? index = new System.Data.DataView(DTL).ToTable(false, new[] { "Chnum" })
.AsEnumerable()
.Select(row => row.Field("Chnum")) // ie. project the col(s) needed
.ToList()
.FindIndex(col => col == _bdr2_name); // returns 2


chnum = Convert.ToInt32(index);

반응형
댓글