Click here to Skip to main content
12,943,913 members (51,072 online)
Rate this:
Please Sign up or sign in to vote.
Hi I'm Creating Project called Test using 3-tier architecture in for this i have followed these steps File->New Project->Asp.Net Web Application And Named as Test.UI now i need DAL, BLL Layers for this File Menu Add New Project but not New->Project and i took class library and followed same for BLL, I gave the reference for BLL of DAL but when i create a new class in DAL and rebuild-ed the solution i cannot access it in BLL project Please Help
Posted 23-Apr-13 0:56am
Updated 23-Apr-13 2:08am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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#[^]

More sample links provided in this answer: Beginner Projects for Visual C# with VS/SQL 2005[^]
_Amy 23-Apr-13 7:03am
Sandeep Mewara 23-Apr-13 7:11am
Thanks Amy.
AlluvialDeposit 23-Apr-13 7:41am
Sandeep Mewara 23-Apr-13 7:46am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

create class and name it as you want, by it will be " BOLpage.cs"
then define every variable used in your program as
 Collapse | Copy Code
private vST;
then create property procedures ( which will get and set the values) as
 Collapse | Copy Code
public String ST
         return vST;
and define functions for your programs as
 Collapse | Copy Code
public void fun1(class_name objectOf_class_name)

Same way create DSLpage.cs for Database interaction.

On your code-behind page , call both classes for appropriate use.
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

Add the particular namespace of the Dal

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

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 4,653
CHill60 2,970
Maciej Los 2,388
Jochen Arndt 1,900
ppolymorphe 1,765

Advertise | Privacy | Mobile
Web02 | 2.8.170518.1 | Last Updated 6 Dec 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100