It is not recommended to use SA (Super Administrator) to log in, but instead to establish a separate user name and password for each database------to enable SQL Server and Windows Authentication mode----This user name can only manipulate this database.
1. Security of the database root node----New User under Login name
2. In the specific database "security"----"User" right click on "New User"----introduce this user name
Note: Be sure not to forget the "Dbowner" two times tick!!
Three-tier architecture: The UI layer calls---the BLL layer calls----the DAL layer (SQL statements can only appear here); The model does not belong to the three layer, only the data transfer between the three layers. The BLL is not a simple forwarding of the DAL, such as "unaudited data cannot be deleted" Such logic should be written into the BLL. (*)methods in the BLL, Dal are not generally declared static , providing extensions for later Dalfactory
DAL layer: Sqlhelper,persondal class, Persondal class contains methods-------int AddNew (person model);---new. BOOL Delete (int id);----delete. BOOL Update (person model); ---update. person get (int id);----query single value. ienumerable<person> Listall ()---Methods for getting all the data.
Method of SqlHelper Class------------ExecuteNonQuery Method--------ExecuteScalar Method-------Executedatatable method-------Executedatareader method 。