asp.net三层应用程序需要帮助 [英] Help needed in asp.net three tier application
问题描述
我创建了一个三层应用程序,但是我遇到了一些问题。
首先,我创建了一个Web项目并创建了一个App_Code文件夹,在其中我创建了三个子文件夹,如BO(业务对象) )BLL(业务逻辑层)和DAL(数据访问层)。
我在所有子文件夹中做了一些classess,但问题是我无法将类从一个文件夹调用到其他文件夹。
此外,我尝试了另一个为BO,BLL和DAL添加类库,并作为参考我制作了Min Project。
仍然无法访问课程。
是否有问题调用虽然名称空间或我真的被困,并且不知道如何解决这个问题。
提前感谢您花时间阅读本文。
参考:如何创建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
这篇关于asp.net三层应用程序需要帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!