Hi Members,
I have searched on Google but didn't find any solution pls anyone help me out.
Problem: I have three Column ID,Value1,Value2 in the Datatable.
DataTable is looking like this :
ID Value1 Value2
1 10 20
2 15 30
I want to find the data between range means let's say in example :
if i enter 15 to 30 it should not allow because 15 is already present between 10 to 20.
This is the code i have written if i enter same value again then i will get message:
if (dtCurrentTable.AsEnumerable().Any(row =>Convert.ToInt32(drCurrentRow["Value1"]) == row.Field("Value1") &&Convert.ToInt32(drCurrentRow["Value2"]) == row.Field("Value2")))
{
//msg
}
So, How to write Code to achieve my task as i explain above.
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Nishant MittalRank #692 · 3.5K reputationPosted Apr 20, 2016, 10:05 PM EDT
imran azam70 reputationPosted Apr 20, 2016, 11:04 PM EDT
Nishant MittalRank #692 · 3.5K reputationPosted Apr 20, 2016, 11:09 PM EDT