Difference between Authorization and Authentication

Difference between Authorization and Authentication

Authentication Authorization Authentication verifies who you are Authorization verifies what you are authorized to do Authenticating a user on a website means that you verify that this user is a valid user, that is, verifying who the user is using username/password or certificates, etc Authorization is the process of verifying if the user has rights/permission to access certain resources or sections of a website, Example : When u login to access some site then your logon credential (userid/password) identifies Example : After successful logon, you will be granted specific role or privileges to access the site.
Difference between count(*) and count(columnname) in Sql

Difference between count(*) and count(columnname) in Sql

COUNT(*) returns the number of items in a group, including NULL values and duplicates.COUNT(ALL expression) evaluates expression for each row in a group and returns the number of nonnull values. COUNT(DISTINCT expression) evaluates expression for each row in a group and returns the number of unique, nonnull values. COUNT(*) : return total number of rows in a table COUNT(ColumnName) : return total number of rows from a table WHERE ColumnName IS NOT NULL COUNT(DISTINCT ColumnName): return total number of rows from table but ignores duplicates values and null values. COUNT(1) : return total number of rows in a table
Check Constraint in SQL-Server

Check Constraint in SQL-Server

A check constraint is a rule that identifies acceptable column values for data in a row within a SQL Server table. The CHECK constraint ensures that all values in a column satisfy certain conditions. Example We will create an Employee table with Check constraint, Employee Table contain Employee ID, Name and Age. We set Check constraint property on Age column. Age should not be less than 18 Create table of Employee as follows.
Rank function in SQL Server

Rank function in SQL Server

The ROW_NUMBER () function in SQL Server returns the sequential number of a row within a partition of a result set, starting at 1 for the first row in each partition. The RANK() function in SQL Server returns the position of a value within the partition of a result set, with gaps in the ranking where there are ties. The DENSE_RANK() function in SQL Server returns the position of a value within the partition of a result set, leaving no gaps in the ranking where there are ties. The NTILE() function in SQL Server return distributes the rows in an ordered partition into a specified number of groups.
ASP.NET Page Life Cycle with Example

ASP.NET Page Life Cycle with Example

PreInit : The entry point of the page life cycle is the pre-initialization phase called “PreInit”. You can dynamically set the values of master pages and themes in this event. You can also dynamically create controls in this event. Init : This event fires after each control has been initialized, each control's UniqueID is set and any skin settings have been applied. You can use this event to change initialization values for controls. The “Init” event is fired first for the most bottom control in the hierarchy, and then fired up the hierarchy until it is fired for the page itself. InitComplete: Raised once all initializations of the page and its controls have been completed. Till now the viewstate values are not yet loaded, hence you can use this event to make changes to view state that you want to make sure are persisted after the next postback PreLoad : Raised after the page loads view state for itself and all controls, and after it processes postback data that is included with the Request instance (1)Loads ViewState : ViewState data are loaded to controls (2)Loads Postback data : postback data are now handed to the page Load: The important thing to note about this event is the fact that by now, the page has been restored to its previous state in case of postbacks. Code inside the page load event typically checks for PostBack and then sets control properties appropriately. This method is typically used for most code, since this is the first place in the page lifecycle that all values are restored. Most code checks the value of IsPostBack to avoid unnecessarily resetting state. You may also wish to call Validate and check the value of IsValid in this method. You can also create dynamic controls in this method.