I have a datatable with columns like First Name, Middle Name, Last Name. I need to filter the records in C# for a condition like shown below.
Select * From Table Where LastName >= 'john'
How to apply this where condition and get the filtered results set that will have records whose last names are like John, Justine, K*****, L***, M***.....Z*** ( last names from J to Z as per alphabetical order)
This datatable is populated by executing a stored procedure and I can't apply the filter at stored proc level as data is encrypted in backend.
I'm able to get the results for equality operator using the below logic.
e.g.
SQL vesion: Select * From Table Where LastName like '%john%'
C# version:
var employees = ( from e in dtEmployee.AsEnumerable()
where e.Field("LastName").Contains("john")
select e ).ToList();
where e.Field
select e ).ToList();
Similarly, need to use the >= operator. How to get records for this filter condition? Can anyone please help on this?

Ankit SharmaRank #141 · 16.1K reputationPosted Sep 26, 2017, 6:29 AM EDT
Sri Ram174 reputationPosted Sep 26, 2017, 11:29 AM EDT
Thank you Ankit for your support.
Unfortunately, the stackoverflow solution doesn't filter records correctly..
Tapan PatelRank #614 · 3.9K reputationPosted Sep 26, 2017, 1:02 PM EDT
Ankit SharmaRank #141 · 16.1K reputationPosted Sep 27, 2017, 12:01 AM EDT
Khan Abrar AhmedRank #778 · 3K reputationPosted Sep 27, 2017, 2:46 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Sep 27, 2017, 10:40 AM EDT
Tapan PatelRank #614 · 3.9K reputationPosted Sep 27, 2017, 10:55 AM EDT