is there any design pattern for data filtering under dynamic conditions.
i am sharing the web application pages and same DataBase and same tables for my customers.
for example i don’t want that customer from company A will see the orders for company B, so the filtering condition is done on the company field.
for other pages the filtering can be done on more fields.
i am using store procedures or sql text to fetch the data.
i am prefering that the data filtering will be done by the sql server.
I think that storing your business logic at the sql server side is not the best idea. Filterting data in SQL makes your stored procedures / schema design more complicated.
It would be much simpler to do dynamic filtering using some ORM (Linq, HNibernate, etc.) framework.
It is of course hard to recommend something without knowing specific of your project but I would go for LINQ which provides flexible data quering.