Hi,
I am fairly new to c# and am trying to write a n-tiered web application. To make sure that I put the logic and code in the right place I just have a question about where to put my code.
I have three main section:
DataAccess code - inside a folder named "BusinessLogic" inside my App_Code folder.
Business Logic code - inside a folder named "DataAccess" inside my App_Code folder.
The presentation layer - All the UI's
If for instance I need to write a SqlDataReader to retrieve records from my database where where would I physically write the code? In the BLL or the DAL?
IE From the presentation layer I call the BLL code.
ContentBLL content = new ContentBLL();
//some code to call the BLL layer...
This is where I start to get confused. In the Business layer Logic layer that I am calling do I write the SqlDataReader code here or do I create one more step and write the SQlDataReader code in the Data Access Level.
IE In the BLL should I add a method that called the DAL? E.G
public static ContentBLL GetPageContent(intID)
{
return ContentDAL.GetItem(ID)
}
and then in my DAL I have a method to perform the actual SqlDataReader E.G
public static ContentBLL GetItem(int id)
{
//return the SqlDataReader code...
}
I have been trying to learn from the tutorials on the asp.net website however for the DAL in the tutorial they use datasets instead. Any help would be greatly appreciated.