Click here to Skip to main content
15,887,262 members
Please Sign up or sign in to vote.
2.17/5 (6 votes)
See more:
I want to learn three layer programming(3 tier Architecture) in c#.net
so i need help for it with sample code and step by step procedure
Posted
Updated 19-Sep-12 21:10pm
v2
Comments
Sergey Alexandrovich Kryukov 17-Sep-12 1:50am    
Nobody has an idea which three you want to learn about and why...
A sample code for... what?
Anyway, it goes nowhere because your whole approach goes nowhere.
--SA
Sergey Alexandrovich Kryukov 17-Sep-12 2:12am    
Ha-ha-ha!...
No, this is not curable...
--SA
Sandeep Mewara 18-Sep-12 9:59am    
I don't see my answer any more! strange? Any chance you deleted mine too by mistake?

Or should I contact Chris & Co to look into?
Sergey Alexandrovich Kryukov 18-Sep-12 16:07pm    
I don't think I could, because I clearly remember I removed only once, and mine is removed. I can see two of your questions at this time...
--SA
[no name] 17-Sep-12 5:15am    
Basically he wanted to know 3 tier Architecture

here is the greatest explanation of 3 tier architecture that is have never seen till http://documentation.ektron.com/cms400/v85/mobile_help/Advanced/Content/Developer85/Architecture/ThreeTier_Intro.htm[^]
 
Share this answer
 
Create a class library - BusinessLogic. Add a reference of it in UI layer project.
Create a class library - DataAccess. Add a reference of it in BL layer project.

Now, from your UI, use the object model and pass on to BusinessLogic project class. This class is a Business logic class. Do the changes as per your need here.
Now, pass on the changed data from business logic class to dataAccess project class. In this class, use ADO.NET and pass on the needed values to Stored Procedure.

For getting back data, it will be transferred from DA to BL and then BL to UI layer.
Have a look at these, explaination with samples:
3-tier architecture in C#[^]
3-Tier Architecture Examples[^]
3-Tier Architecture in ASP.NET with C#[^]
3-Tier Architecture in asp.net using c#[^]
 
Share this answer
 
Refer similar QA on CP: click here[^]
 
Share this answer
 
Reposting my answer as someone deleted my previous answer! :doh:

Create a class library - BusinessLogic. Add a reference of it in UI layer project.
Create a class library - DataAccess. Add a reference of it in BL layer project.

Now, from your UI, use the object model and pass on to BusinessLogic project class. This class is a Business logic class. Do the changes as per your need here.
Now, pass on the changed data from business logic class to dataAccess project class. In this class, use ADO.NET and pass on the needed values to Stored Procedure.

For getting back data, it will be transferred from DA to BL and then BL to UI layer.
Have a look at these, explaination with samples:
3-tier architecture in C#[^]
3-Tier Architecture Examples[^]
3-Tier Architecture in ASP.NET with C#[^]
3-Tier Architecture in asp.net using c#[^]
 
Share this answer
 
Comments
[no name] 18-Sep-12 10:14am    
It's there.... solution #2?
Sandeep Mewara 18-Sep-12 10:19am    
Thats strange!

I see it too. Wait...

Yeah, look here: http://www.codeproject.com/Answers/460379/Three-Layer-Programing-in-Csharp-NET
I somehow landed on that URL (via comments email) and posted it there.

Looks like some URL issue. Need to report CP Bugs & Sugs....


[I am not removing it for now and would request everyone to not delete it as will share with Chris]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900