Create a Class library project
On the File menu, choose New Project.
In the New Project dialog box, in the Templates pane, click Class Library.
In the Name box, type Persons, and then click OK.
Tick "Add a new Solution" and select "put into solution." ”
A new Class library project opens, and the code Editor displays the class module Class1.cs.
In Solution Explorer, right-click Class1.cs and select Rename, and then change the name to Persons.cs.
Note that the name in the code editor is also changed to Persons.cs.
On the File menu, choose Save All.
In the Save Project dialog box, click Save.
Once a class library is created, a production class library is generated. DLL file, and then you need the project application on OK!!
In addition
The steps for developing a three-tier architecture and referencing your own class library DLLs to a Web project are as follows:
If you follow the PetShop4.0 standard, this is probably the case.
1. Create model to realize business entity.
2, create idal, implement interface.
3, create Sqlserverdal, implement the method in the interface. (If the dbutility layer is used, it is established before this step)
4. Add the configuration information in Web. config to the Sqlserverdal assembly.
5. Create a dalfactory that returns an instance of the specified class of the assembly.
6, create the BLL, call Dalfactory, get an instance of the specified class of the assembly, complete the data operation method.
7. Create the Web and call the data manipulation method in the BLL.
Two. Add references to projects on the project, the referenced project DLL will be automatically generated into the bin of the referenced project, and LZ several said the results are the same.
Share
How to create and use classes and class libraries in a C # project