Hi,
I am filtering records using linq based on the column Time, getting error like. “The source contains no DataRows”.
Source data

Dispatcher_DT.AsEnumerable().Where(Function(row)DateTime.Now.TimeOfDay.Subtract(DateTime.Parse(row(“Time”).ToString).TimeOfDay).TotalMinutes >= 50).CopyToDataTable()
Thanks
Shaik Muktharvalli
Anil_G
(Anil Gorthi)
2
@shaik.muktharvalli1
use if condtion first in which you can check the count and then if count>0 then copytodatatable else it means no rows
condition : Dispatcher_DT.AsEnumerable().Where(Function(row)DateTime.Now.TimeOfDay.Subtract(DateTime.Parse(row(“Time”).ToString).TimeOfDay).TotalMinutes >= 50).Count>0
cheers
THIS Linq working on local studio but not in VM @Anil_G
is there any solution please
thanks
shaik
Anil_G
(Anil Gorthi)
4
@shaik.muktharvalli1
this would work anywhere
there must be some issue…please check
or mention what is not working and we can check
cheers
have to get greater than 50 min compare to present time from “Time” Column

please give me update Linq @Anil_G
Thanks
Shaik
thank you @Anil_G condition working fine
1 Like
system
(system)
Closed
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.