Wednesday, 29 August 2018

Boolean Value Column Data Filter A Data Table Dynamically Using LINQ With C#?

bool BlnSelect = DTResult.AsEnumerable().Any(row => Convert.ToBoolean(1) == row.Field<bool>("SELECT"));
if (BlnSelect)
{
DataTable _DTUpdate;
_DTUpdate = DTResult.AsEnumerable().Where(row => row.Field<bool>("SELECT") == true).CopyToDataTable();
return true;
}
else
{
return false;
}

No comments:

Post a Comment