Design, implement a general data access layer for an ASP.NET application (2)

zhaozj2021-02-16  43

Design, implement a general data access layer for an ASP.NET application (2)

Translation: nxyc_twz@163.com

1.2 prototype installation

Before we continue the next step, I suggest that you install the sample program Daprototype, because the following steps will involve it. Solution Daprototype.sln consists of the following class library (you can view the section 3).

Collection Description BLT Business Logic Layer DAT Data Access Layer HTTPTRACEMODULE Data Set Data Set Data Conveyed between Layers and Layers in the presentation layer tracking error TDS

Section 3

Please install the sample program as follows:

Download Document Daprototype.zip Create a new ASP.NET C # network application Daprototype, then replace it with the file you just downloaded. Open and execute SQL script Daprototype / Sqlscript / Daprototype.sql, thus in our data layer (DT The database is created in the database. In order to create an event log of the presentation layer, the business layer, and the data access layer, open the C # item Daprotype / Elcreator / Elcreator.csproj (see 1.4). Adjust the computer name and execute it. For security considerations, we cannot integrate this part of our web applications. Window ASPNET user does not have sufficient privileges to create windows resources adjustment Adjust configuration values ​​for the keys in the DAPrototype / configuration values ​​in Web.config keys, especially localConnection, daMachine, blMachine and plMachine (See Section 4).

Value = "Server = localhost; database = northwind; uid = sa; pwd = moses

POOLING = true; max pool size = 100; "/>

Section 4 Sets the Daprototype / SerchCHCustomOrDers.aspx page.

I hope that you can run our app now.

1.3 Define Data Set

DataSet is a memory-type database that relies on database models. DataSets are used to implement data communication of the interface layer. It has data sheets, foreign key constraints, and table relationship triggers. DataSets are completely autonomous because they must be in the data source. Moreover, DataSet can also handle structured data, such as XML DOM, etc. Let us see an example (see section 5). The following XML files list some states and governments in Germany.

XML file

XSD file of the corresponding data

转载请注明原文地址:https://www.9cbs.com/read-26401.html

New Post(0)