Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Reply
Select record between two column from DataTable.
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
imran azam
8y
274
1
Reply
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<Int32>("Value1") &&Convert.ToInt32(drCurrentRow["Value2"]) == row.Field<Int32>("Value2")))
{
//msg
}
So, How to write Code to achieve my task as i explain above.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Bootstrap tab
How to open IIS v5.1 Url rewrite option?