Thursday, 11 February 2016

Public Static Void Main String Args meaning in C#

Public:- This is an access specifier. This means that main() can be called from anywhere.

Static:- This is a keyword which indicate that without creating an object of this class this method can be called. This is optional.

Void:- This is a return type and means that main() returns no value.

Main():- This is name of the method. It is special because it is start of the program.

String[]:- This is an array of string type.

Args:- This is name of parameter. "args" is not special; you could name it anything else and the program would work the same.

Monday, 4 January 2016

Windows 10 Shortcuts

Virtual Desktops
Virtual desktops are finally added as a built-in feature in Windows 10.
There are also some keyboard shortcuts for quickly managing virtual desktops.

[Windows Key] + [Ctrl] + [D]
Create a new virtual desktop and switch to it

[Windows Key] + [Ctrl] + [F4]
Close the current virtual desktop.

[Windows Key] + [Ctrl] + [Left / Right]
Switch to the virtual desktop on the left or right.

Window Snapping

[Windows Key] + [Left]
Snap current window to the left side of the screen.

[Windows Key] + [Right]
Snap current window the the right side of the screen.

[Windows Key] + [Up]
Snap current window to the top of the screen.

[Windows Key] + [Down]
Snap current window to the bottom of the screen.

Windows 10’s newest features

[Windows key] + [A] 
Open the Action Center

[Windows key] + [C]
Launch Cortana in listening mode (for voice commands)

[Windows key] + [I]
Open the Settings app

[Windows key] + [S]
Launch Cortana

[Windows key] + [Tab]
Open Task View

[Windows key] + [Ctrl] + [D]
Create a new virtual desktop

Browser shortcuts (works in Edge and most other browsers)

[Ctrl] + [T]
Open new tab .

[Ctrl] + [D]
Bookmark page

[Ctrl] + [L]
Highlight current URL (good for typing a new address or copying the current one)

[Ctrl] + [Tab]
Cycle through your open tabs in forward direction.

[Ctrl] + [Shift] + [Tab]
Cycle through your open tabs in backward direction.

[Ctrl] + [Enter]
Add “.com” to the end of a web address and go (e.g. type ‘google’ then Ctrl + Enter to get google.com)

[Ctrl] + [Shift] + [T]
Open the previously closed tabs.


Saturday, 2 January 2016

Windows 7 Tricks (Part - 2)

[Windows] + [Spacebar]
Make all open windows transparent to view gadgets and icons on desktop.

[Windows] + [D]
Show or hide the desktop.

[Windows] + left arrow OR [Windows] + right arrow
Dock selected window to the left or right half of your screen.

[Windows] + up arrow OR [Windows] + down arrow
Maximized and restores the selected window.

[Windows] + [SHIFT] + up arrow OR [Windows] + [SHIFT] + down arrow
Maximizes and restores selected window in vertical dimension only.

[Windows] + [Tab]
Launch 3D representation of open windows and click [Tab] key again to flip through them.

[Windows] + [+] OR [Windows] + [-]
Activates Windows Magnifier to zoom in or out of screen.

[Ctrl] + [Alt] + [D]
Switch to docked mode.

[Ctrl] + [Alt] + [L]
Switch to lens mode.

[Ctrl] + [Alt] + [F]
Switch from docked or lens mode back to full screen mode.

[Ctrl] + [Alt] + [I]
Invert colors.

[Ctrl] + [Shift] + [Esc]
Show the task manager.

[Windows] + [Esc]
Exist magnifier views.

Friday, 1 January 2016

Windows 7 Tricks (Part - 1)

Windows & Task bar

[Alt] + [Ctrl] + left/right/up/down arrow
Flip Window

[Alt] + [Tab]
Cycle through open windows.

[Windows] + [T] OR [Windows] + [SHIFT] + [T]
Move focus to front or back of task bar. Press [T] again while holding the [Windows] key to cycle through items in the task bar from left to right or you can use arrow keys.

[Windows] + [B]
Puts focus on the ‘show hidden icons’ button on the system tray.

[Windows] + [1] through [Windows] + [9]
Launch first through ninth icon on task bar, including items pinned to task bar.

[Windows] + [SHIFT] + [1] THROUGH [Windows] + [SHIFT] + [9]
Starts new instance of respective task bar icon.

[Windows] + [Ctrl] + [1] THROUGH [Windows] + [Ctrl] + [9]
Cycles through multiple instances of the respective icon.

[Windows] + [Alt] + [1] THROUGH [Windows] + [Alt] + [9]
Opens jump list for respective icon.

Saturday, 26 December 2015

Server Based State Management Techniques

ASP.NET offers you a variety of ways to maintain state information on the server, rather than persisting information on the client. With server-based state management, you can decrease the amount of information sent to the client in order to preserve state, however it can use costly resources on the server. The following sections describe three server-based state management features: application state, session state, and profile properties.

Application State:
ASP.NET allows you to save values using application state — which is an instance of the HttpApplicationState class — for each active Web application.Thus, application state is useful for storing information that needs to be maintained between server round trips and between requests for pages.
Application state is stored in a key/value dictionary that is created during each request to a specific URL. You can add your application-specific information to this structure to store it between page requests.

Session State:
ASP.NET allows you to save values by using session state — which is an instance of the HttpSessionState class — for each active Web-application session.Session state is similar to application state, except that it is scoped to the current browser session. If different users are using your application, each user session will have a different session state. In addition, if a user leaves your application and then returns later, the second user session will have a different session state from the first.

Profile Properties:
ASP.NET provides a feature called profile properties, which allows you to store user-specific data. This feature is similar to session state, except that the profile data is not lost when a user's session expires. The ASP.NET profile allows you to easily manage user information without requiring you to create and maintain your own database. In addition, the profile makes the user information available using a strongly typed API that you can access from anywhere in your application. You can store objects of any type in the profile. The ASP.NET profile feature provides a generic storage system that allows you to define and maintain almost any kind of data while still making the data available in a type-safe manner.

State Management Techniques in ASP.NET

Each time when page is posted to the server a new instance of the Web Page Class is created. Due to this all information associated with the page and controls on the webpage would be lost with each round trip. For Example, if user enters information into a textbox, that information would be lost in the round trip from the client device to server.
To overcome all these limitations ASP.NET includes several options that help you preserve data on both a per-page basis and an application-wide basis.

These techniques are divided into two categories:
  1. Client Based State Management Techniques
  2. Server Based State Management techniques.

Client Based State Management Techniques:
  • View State 
  • Control State 
  • Hidden Fields
  • Cookies 
  • Query Strings

View State:
This is the default way used to preserve page and control property values between round trips. The ViewState property provides a dictionary object for retaining values between multiple requests for the same page.

In general we can say it is used for storing user data in ASP.NET, sometimes in ASP.NET applications the user wants to maintain or store their data temporarily after a post-back. In this case View State is the most used and preferred way of doing that.
This property is enabled by default but we can make changes depending on our functionality, what we need to do is just change the EnableViewState value to either TRUE for enabling it or FALSE for the opposite operation.

Features:
Some of the features of view state are:
  • It is page-level State Management. 
  • Used for temporarily data holding.
  • Can store any type of data.
  • It is property dependent.

Control State:
ControlState property allows you to persist property information that is specific to a control and cannot be turned off like the ViewState Property.

Features: 
Some of the features of control state are:
  •  Defines a custom view.
  • Used for enabling the View State Property.
  • View State property declaration.
  • Cannot be modified.
  • Accessed directly or disabled.
Hidden Fields:
A hidden field is used for storing small amounts of data on the client side. In other words it is a container of some objects but their result is not rendered on our web browser. It is invisible in the browser.
A hidden field does not render visibly in the browser, but you can set its properties just as you can with a standard control. 

Features:
Some of the features of hidden field are:
  •  Use small amount of memory.
  • Direct functionality access.

 Cookies:
A cookie is a small amount of data that is stored either in a text file on the client file system or in-memory in the client browser session. It contains site-specific information that the server sends to the client along with page output.
Cookies can be temporary (with specific expiration times and dates) or persistent. Cookies are further divided into two categories.
  •  Temporary Cookies.
  • Permanent Cookies.
Temporary Cookies
Temporary cookies aren't stored in the client's hard drive permanently. It maintains user information as long as the user uses the services. It is simply the opposite procedure of a permanent cookie.

Permanent Cookies
Cookies having an expiration date are called permanent cookies. This type of cookie reaches their end as their expiration dates comes to an end. In this cookie we can set an expiration date.

Features:
Some of the features of cookies are:
  •  Store information temporarily.
  • It is just a small sized texted file.
  • Can be changed depending on requirements.
  • User preferred.
  • Requires only a few bytes or KBs of space for creating cookies.
Query Strings:
A query string is information that is appended to the end of a page URL. A typical query string might look like the following example:
In the URL path above, the query string starts with a question mark (?) and includes two attribute/value pairs, one called "category" and the other called "price."
Query strings provide a simple but limited way to maintain state information.

Features:
Some of the features of query strings are:
  •  Generally used for holding values.
  • Working temporarily.
  • Switch information from one page to another page.
  • Increase performance.
  • Use virtual and real path values URL routing.

Monday, 16 November 2015

Difference Between Eval and Bind in Asp.Net

The Eval function is used to define one-way (read-only) binding.
The Bind function is used for two-way (updatable or read/write) binding.
In addition to calling Eval and Bind methods to perform data binding in a data-binding expression, you can call any publicly scoped code within the <%# and %> delimiters to execute that code and return a value during page processing.

Thursday, 5 November 2015

Use of SET NOCOUNT in Stored Procedures

SET NOCOUNT ON statement into store procedures can reduce network traffic, because client will not receive the message indicating the number of rows affected by T-SQL statement.

When SET NOCOUNT is ON, the count is not returned.
When SET NOCOUNT is OFF, the count is returned.
The @@ROWCOUNT function is updated even when SET NOCOUNT is ON.

The setting specified by SET NOCOUNT is in effect at execute or run time and not at parse time.

Example:

USE DEMO

GO

SELECT * FROM [DEMO].[EMP];

Message:

12 row(s) affected

USE DEMO

GO

SET NOCOUNT ON

SELECT * FROM [DEMO].[EMP];

SET NOCOUNT OFF

Message:

Command(s) completed successfully.