I am finishing off a C# ASP.NET program that allows the user to build their own computer by selecting hardware components such as memory, cpu, etc from a drop down lists. The SQL datatable has 3 columns; ComputerID, Attribute and Value. The computerID is an ID that corresponds to a certain computer in my main datatable of products, the Attribtute is the name of the hardware component; memory,cpu, hard drive etc.. and the value is the value assigned to that attribute, such as 1GB or 2.8GHz 320GB. This means that a computer will have multiple attributes.
What I am trying to do it narrow down the results by first selecting all computers that meet the first attribute requirements and then getting from that list, all computers that meet the next requirement.. and so on for about 10+ attributes.
I thought it might be a good idea to show you an example of my LINQ to SQL query so that you have a btter idea of what I am trying to do. This basically selects the ComputerID where the the computers memory is larger than 1GB.
var resultsList = from results in db.ComputerAttributes
where computer.Value == "MEMORY" && computer.Value >= "1"
select results.ComputerID;
Next I want to select from the resultsList where the CPU is say, faster than 2.8Ghz and so on.
I hope I have given you enough information. If anyone could please give me some advice as to how I might go about finishing this project that would be great.
Thanks