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 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Nishant MittalPosted Apr 21, 2016, 3:09 AM
DataRow[] result = table.Select("Size >= 230 AND Sex = 'm'");imran azamPosted Apr 21, 2016, 3:04 AM
Nishant MittalPosted Apr 21, 2016, 2:05 AM