njgroup
asked on
how to check value if it is between two values in linq?
hi,
I was trying to check value if it is between two values from xml file, so how to perform between "something" and "something else" using linq?
here is my try
I was trying to check value if it is between two values from xml file, so how to perform between "something" and "something else" using linq?
here is my try
var countries = from country in xmlDoc.Descendants("IpCountries")
where Dot2LongIP.ToString() between country.Element("beginningIp").Value and country.Element("endingIp").Value
select new
{
hostIPAddress = country.Element("beginningIp").Value,
hostName = country.Element("endingIp").Value,
hostLocation = country.Element("countryCC").Value,
hostBrowserType = country.Element("countryCCC").Value,
hostBrowserVersion = country.Element("country").Value,
};
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
NP. Glad to help :)
ASKER
I was looking for something better than A grade to assign :))