Facing problem to fetch data from data table

  • Thread starter Thread starter Sudip_inn
  • Start date Start date
S

Sudip_inn

Guest
i convert my datagridview to datatable and when i issue a linq on that datatable to fetch a data from a particular column then i am not getting data. see the code.

DataTable dtMappedSectionNotEmpty = dgvLineMatch.ToDataTable("passed")
.AsEnumerable()
.Where(x => !string.IsNullOrEmpty(x.Field<string>("Matched Section")))
.Select(r => new { Col = r.Field<string>("2018 FY NEW") }).ToList().ToDataTable();

this line convert my datagridview to datatable dgvLineMatch.ToDataTable("passed") dgvLineMatch is my datagridview

see a screen shot of my data table which is converted from datagridview.

1527915.png

see in screen shot there is a column called 2018 FY NEW in my data table but when i try to fetch data from my datatable by LINQ then i am not getting data for column 2018 FY NEW. rather getting empty data. please tell me what to rectify in my code. thanks

Continue reading...
 
Back
Top