DictBase(Id (,) ,Name ())
Factory method mode
IDAL layer (add an interface and define a method in it)
Obtain List <Model. DictBase>Interface: Category dictionary name
DALFactory layer (DataAccess new interface implementation factory mode)
AssemblyPath = ConfigurationManager. configurettings [ClassNamespace = AssemblyPath +Factory interface: Category dictionary name
SQLServerDAL layer (add a class in the project and inherit from the interface)
Obtain List <Model. dictBase> SQL =. format (<Model. dictBase> list = List <Model. dictBase> (SqlDataReader dr = DBUtility. dbHelperSQL. executeReader (ConnString. connReadonly, CommandType. text, SQL, = dr [(obj! = & Obj! ==( = Dr [
BLL layer (create a factory class so that it inherits from the interface, create a method, and set its return value)
Letao. IDAL. IDictBase dal = List <Model. DictBase>Specific factory type
Model layer (class)
Id {; Name {;Category: dictionary key name
Note:
DBUtility layer (DbHelperSQL class, ConnString class)
SqlDataReader ExecuteReader (connectionString, CommandType primitive type, plain text, ===Returned data content (SqlDataReader) (_ conn = System. Configuration. ConfigurationManager. ConnectionStrings [_ conn = (_ connReadonly = System. Configuration. ConfigurationManager. ConnectionStrings [_ connReadonly =Read-Only database connection string
?> <AppSettings> <add key = value =/> </appSettings>App. config file
Page
Page_Load( (Request.Headers[] != && Request.Headers[].ToLower() == = (Request[] == = <Letao.Model.DictBase> list = List<Letao.Model.DictBase>=
Effect
Knowledge point:
1. Convert from database to json string
2. Whether X-Requested-With is loaded for the first time
Results of Google Chrome review elements
Reference URL: 1. ASP. NET uses data in SQL Server to generate JSON strings
Http://www.cnblogs.com/jacksonwj/archive/2008/08/10/1264525.html
2. asp.net simple factory mode and factory method mode
Http://www.jb51.net/article/29212.htm