What is the best approach? I have a C# .NET Web Forms website which gathers a list of user profiles based on one or more tags. The site connects to a SQL database and uses Stored Procedures for most data retrieval.
My first (half-retarded) thought would be to build a list of parameters: tag1, tag2, tagN. Pass that list to a SP. In the SP, build the WHERE clause by looping through the parameters.
Before i can even do the WHERE loop, how would I build my parameters in SQL?
It'd be nice if I could just pass the SP an array or list to then bust apart and build my query. However, I don't know how to do this - if I did, I doubt the efficiency would be desirable.
I can use CommandType.Text and spit out a huge query right there in code. That doesn't sound very efficient either. I want to keep the SQL/C# stuff as separated as possible. This site is already a mess and a half..
Do any of you have thoughts on this?