comparing against a range of values
Does anyone know of a way to a compare a single value against a range of values, like you can do with the SQL IN() statement?
In SQL you can say:
SELECT * FROM tblAddress WHERE ZipCode IN('92131', '92156', '92163')
and you will get any rows that have a ZipCode value matching any of the values in the brackets.
In vb.net I want to say:
If strZipCode In("92131", "92156", "92163") Then
'do some stuff here
End If
but obviously there is no "In" statement in vb.net. I also want to get away from saying:
If strZipCode = "92131" Or strZipCode = "92156" Or strZipCode = "92163" Then
'do some stuff here
End If
This gets messy when there are many values.
Any suggestions would be appreciated.