Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
3.71/5 (3 votes)
See more:
Hi,

I am new to 3-Tier architecture.
I am implementing 3-Tier architecture.
I taken two class libraries for Business layer and Data access layer.
And written the class for INSERT method in DataAccess layer.
If I call the class in Business layer it is not taking,it giving error like
"Type or namespace could not be found(are you missing directive or an assembly reference)"

I have class InsertBAL() in BAL and InsertDAL() in DAL.
Can anyone tell me how to give reference of DAL in BAL and BAL in UI.

Thank you,
Posted

1 solution

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
 
v2
Comments
Manas Bhardwaj 11-Jun-12 5:52am    
Correct +5!
Sandeep Mewara 11-Jun-12 9:13am    
Thanks Manas.
jaipal0908 11-Jun-12 6:00am    
Thank you sandeep.It is working
Sandeep Mewara 11-Jun-12 9:14am    
Welcome. Good to know.
Prasad_Kulkarni 11-Jun-12 6:13am    
Great, +5!

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