SQL Server security Settings

Source: Internet
Author: User

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 。

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.