Asp.net| Skills | data
Today, one hours of time to learn anf dal, feel their own anf have a further understanding, followed by the question, in some points to publish their own experience.
Using oneself very vegetable
(1) The DAL (data layer) class composition:
ANF's data layer is mainly Forumsdataprovider (for short: FDP) and Sqldataprovider (hereinafter: SDP), the following "FDP" and "SDP" refer to the above name.
(2) The DAL (data layer) class relationship:
Forumsdataprovider and Sqldataprovider, two classes, "FDP" is an abstract class, "SDP" Inherits "FDP", and "SDP" provides all of the abstract's type that implements the "FDP". Object and type method.
(3) The DAL (data layer) class function:
"FDP" is the base class, all the underlying operations of the database encapsulated in the "SDP", the bottom through the IDataReader access to the SP and TSQL, basically an SP encapsulated the Tsql-siud, delete Mark's way to remove data, An update or insert operation is judged by the primary ID passed in.
(4) DAL (data layer) access and operation of the database steps:
When a page to the data access, first "SDP" through the query to the corresponding ArrayList, like Entityclass or ArrayList of the package class, the instance (by the API Cache, I think it is anf to improve the speed of the database read the main means) get methods, through "reflection" reflection constructs-getconstructor "FDP" abstract method and object (actually executed or "SDP" methods), Finally bind to the Repeater or DataList, such as the image, complete data reading.
I am very good at the level of food, not afraid to throw bricks ...