How to communicate or work in 3-layered architecture in C#.Net Windows Application
Introduction:
In my previous articles i explained the WPF Architecture, How to create 3-tier architecture in C#.Net Windows Application,Now in this Example you will know how to consume or how to work with 3 layered architecture in C#.Net Applications.
Description:
After creating three tier architecture to work with this we have to add references between these three layers. The communication between these three layers is as follows
3-tier Architecture layers communication
For any Db operations like select,insert,delete,update the request processing is as show in above image.
Suppose if you are performing select operation you called a method in business access layer from presentation layer(Form). In business access layer if you need to perform any validations then you can do there and then call the method in data access layer which will communicate with database and process your request and returns the result back to business access layer. From Business Access Layer data is returned to called method in .cs file or .vb file.
Here i will explain the communication between three tier architecture with an example. Form looks likes this
This form level coding i.e .cs file coding which i had written is as follows
I have written business access layer coding for this form is as follows
Data access layer coding for this form is as follows
Observe the method calling between three layers you will get flow.
Download Here:
Download Database for this Application
To work with this download Visual Studio Solution and Database Backup from Above two links and add database backup file to Your system and change the db connection string, Db name is CS9DB.
Observe the flow of input values and output values how they are inputted and outputted Business layers and data access layers.
Conclusion
I hope you got an idea how to work with 3 layered architecture of .Net Application. In my next article i will explain communication between three layered architecture web application i.e using Asp.Net.
I would like to have feedback from my blog readers. Your valuable feedback,Suggestions,Questions, Comments about this article are always welcome.
Where found database
ReplyDeleteSorry dear for late reply.
ReplyDeleteYou can find database for above three tier architecture from here
https://app.box.com/s/56rgz9zppyp7ye204v2q.
It is also updated in Post also check there, How to work with this three tier example.
Its Working Perfectly for me ... Thanks Sir
ReplyDeleteHi, do you have sample 3-Tier with VB.NET?
ReplyDeleteNice Artical Sekhar Babu...
ReplyDeletei want to something from you...
i just know that we can perform insert, update, delete and select
operation using Only One Store Procedure but i don't know how to
implement it...so please guide me for that...
i will wait 4 Your +Ve Response
Nice Artical sekhar Babu...
ReplyDeleteI want to know something From You...
I just Know that We can Use Only One StoreProcedure For Insert, Update, Delete And Select
Operation But I Don't Know How To Implement It so Please Guide Me For That
I am Waiting 4 You +Ve Response
Thank you Sir
Hello Shekhar,
ReplyDeleteThank you for posting this project but i am unable to use the the database please tell me how to use the db file that is given in .bak format