Windows Application using 3-tier architecture


This Article will explain about the creating Windows application using 3-Tier architecture. I am explaining about each layer in details, creating each of the project and then adding the references, developing our windows application and then getting the data in the GridView. You will find the screenshots for each of the activities which will be performed during creation of the application. i have writing the code and made it to available as the screenshots so that it will be highly visible and people can d

Hi Friends,
In this article, i am explaining about the creating the Windows application using 3-Tier architecture. I will explain about each layer of the 3-tier architecture. the use of Business logic layer, data Access layer and how we can create those layers to make our application as layered architecture.
You will see each of the steps performed are having screenshot so that it will be easy to understand and will give the real time flavor of the applications. I have specially taken care of the Coding standers so we all can follow the same when working in the real environment.
it will easy to understand as the coding also i kept as screen shots and each keywords will be easily recognized.
I will begin with the step where you have installed the Visual Studio so i am not explaining about the installation of Visual Studio and all. I will pre-assume that you have started the Visual studio already and then opened the first home window.
Creating windows app using 3 tier architecture
1. Create a new windows application.Enter the name and press OK.
1
2. Right click on the solution of the Windows Application and add the new project
2
3. Choose Class Library Project and enter the name as BLL(Business Logic Layer)
3
4. Enter the name (Business Logic Layer) and press OK
5. Same way add one more Class Library project and provide the name DataAccessLayer and press OK.
6. Your solution should have 3 different projects by this time.
4
7. Build the whole application.
8. Go to your main project and right click to add the reference of the BusinessLogicLayer.dll
5
9. Add the namespace of the BusinessLogicLayer to your form
6
10. Click on the button and go to its event handler. Here you need to create the object of the BusinessLogicLayer class and then access its method.
11. So first create a class in BusiessLogicLayer. Right click on BusinessLogicLayer and add a class. Provide the name
7
8
12. Now your solution should look like below:
9
13. Write the method in this new Class called as EmpBLL as below. To get all employee, write a method. Here we need to add the reference of DataAccesslayer class object. So first we need to create a class in DAtaAccessLayer similar to this
14. Go to the DataAccessLayer project and add a class with the name EmployeeDLL.csand write a method to get all the employees.
10
15. Build the project and Comeback to the BLL. Add the DataAcesslayer.dll in to this project as reference
11
16. Now add the namespace for the DataAccessLayer in to this project(BLL)
12
17. Now create the object of the DataAccesslayer class and return the result as
13
18. After adding all the references, your solution should look like below:
14
19. Now design your form as:
15
20. Write the eventhandler for the button to get the employee details by calling the BusienssLogic layer method as
16
21. Run the application and click on the Button, to get the employee details from the table in the database.
Hope it will be helpful to you.


Comments



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: