That's the job of the data object. If you put the SQL SELECT in the biz layer, then it knows too much about the data. For example, you may have a query called GetCustomerByID. The UI will call the GetCustomerByID method of the biz tier and pass the ID. The biz tier then calls the GetCustomerByID of the data tier and also passes the ID. The SQL SELECT is created in the data tier with something like WHERE CustomerID = TheParameter. This is sent to the data store, which returns the data. The data then goes from the data tier to the biz tier and into the UI.
>Hi all,
>i am just getting into the whole n-tier thing and i have a question.
>
>when creating your data object is it best to store there all the sql queries for your various functions (save, delete etc.) or is it better to pass the sql string to the data object from the business rules object?
>
>thanks
>Jordan
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer