且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

asp.net三层应用程序需要帮助

更新时间:2022-11-06 18:17:10

参考:如何创建3层 [ ^ ]



..以及更多类似的答案 CP答案 [ ^ ]


在实时场景中,在App_Code中添加两个文件夹不被视为三层架构。您必须创建两个不同的类库项目,然后从您的应用程序添加引用它们例如:创建一个类库项目,如YourProjectBusinessLayer和另一个类库项目作为YourProjectDataAccessLayer。为YourProjectDataAayLayer添加对YourProjectBusinessLayer的引用,以及对YourProjectBusinessLayer的Web应用程序项目的引用。



这将使层次结构如下:



YourProject-> YourProjectBusinessLayer-> YourProjectDataAccessLayer



希望它有所帮助。



[ ^ ]







这个 [ ^ ]



是很好的例子。


请参考以下链接:

文章:

异常处理在3层架构中 [ ^ ]

3层建筑学C# [ ^ ]

类似主题:

3层架构在.Net [ ^ ]

插入,更新,使用3层架构删除 [ ^ ]

Asp.net中的三层架构 [ ^ ]







- Amit

I created a three tier application, but I''m having some problems.
First i created a web project and created also one App_Code folder in which I created three subfolders like BO (business objects) BLL (business logic layer) and DAL (data access layer).
I made some classess in all of subfolders but the problem is that i can not call classes from one folder to other.
Also i tryed another with adding class libraries for BO, BLL and DAL and as a reference I made Min Project.
Still having trouble to access the classes.
Is there a problem to call the though namespaces or I''m really stucked and have no clue how to fix this.
Thank you in advance for taking time reading this article.

Refer: How to create 3 tier[^]

..and more similar answers on CP Answers[^]


In real time scenario adding two folders in App_Code is not considered as three tier architecture. You have to create two different class library project and then add reference them from your application For example: Create a class library project like YourProjectBusinessLayer and another class library project as YourProjectDataAccessLayer. Add a reference to YourProjectBusinessLayer for YourProjectDataAccessLayer and a reference to your web application project for YourProjectBusinessLayer.

This will make the hierarchy something like:

YourProject->YourProjectBusinessLayer->YourProjectDataAccessLayer

Hope it helps.

This[^]

and

This [^]

are good examples to start.


Refer the links below:
Articles:
Exception Handling in 3-Tier Architecture[^]
3-tier architecture in C#[^]
Similar Threads:
3 Tier Architecture In .Net[^]
Insert,Update,Delete using 3 Tier Architecture[^]
Three Tier Architecture in Asp.net[^]



--Amit