Firstly, I am not certain this is the best way to handle this AT ALL ... totally open to alternative solutions.
Secondly, I feel like I'm missing the obvious ... but I'm still missing it so not to proud to ask!
UPDATE: .NET 3.5 environment w/ SQL 2005, so things like dynamic linq possible, although I always tend to think of dynamic (build on fly) queries of any kind as kind of clunky. PITA to maintain.
UPDATE 2: In response to northpole, pseudo code / written word logic / sql / linq / C# all acceptable (!) ... more of a notional "what is a good approach" than I need code kind of question.
Given a table of "shoes" that looks like this:
ShoeID PropertyName PropertyValue 1 COLOR RED 2 COLOR RED 2 SIZE 11 3 COLOR RED 3 SIZE 11 3 MANUFACTURER GUCCI
I need a way(s) to query for shoes such that
COLOR=RED returns
1 2 3
COLOR=RED and SIZE=11 returns
2 3
COLOR=RED and SIZE=11 and MANUFACTURER=GUCCI returns
3
At design time, I do not know how many different properties that there might be, nor do I know how many query parameters there might be ...
Hopefully this makes sense ... if not, please comment accordingly and I'll try again.