Tag: tricks

Lambdas Expression for Getter-Only Auto-Properties in C# 6.0

C# 6.0 lets the developers use the lambda expression to implement the getter value of the read-only property . Whenever a lambda expression is found , the C# compiler identifies it as the property with only get method rather than a field. Lambdas Expression for Getter-Only Auto-Properties in C# 6.0 Below is a sample code snippet demonstrating the use of Lambdas Expression for Getter-Only Auto-Properties…

How to Validate an email address using Regular Expression in C# ?

You can validate an email address in C# using regular expressions which provides the developers to play around with different patterns. Below is a code snippet that shows how you can use regular expression to validate an email address in C# . How to Validate an email address using Regular Expression in C# ?

How to remove user from group using command line in Windows 10 ?

You can use the net localgroup command and specify the /delete parameter to remove the user from a group using command line in Windows 10. The format of the command is as shown below. net localgroup <groupname> <username> /delete How to remove user from group using command line in Windows 10 ? 1. Open command prompt from the elevated administrator mode. 2. Enter the command….

Alias Names for Tables in SQL Query

There are times when you write query and end up qualifying the columns references by indicating the table name. For example , In the above query , the Department table is referred in the GroupName and Name column. Instead of mentioning the table table , we could provide a shortname or alias name for the table and use the alias name instead. The full use…

How to specify the Sort order for a Query in SQL Server ?

If you want the sort the records in descending order by more than one column instead of the default ascending order , you can use the DESC or DESCENDING to this. How to specify the Sort order for a Query in SQL Server ? Here’s the query which retrieves the Department records in Descending order by two columns – Name and GroupName.

How to get the Size of all tables in a SQL Server ?

In SQL Server 2014 Management Studio , you can get the size of all tables in a SQL Server from the Object explorer details window. How to get the Size of all tables in a SQL Server ? 1. In SQL Management Studio 2014 , navigate to the Object explorer details screen from View -> Object explorer details menu or by simply pressing the F7…

Searching in an Array in JavaScript

If you want to search an array for a value in JavaScript and retrieve the index of the found array element , you can use the Array’s indexOf method. How to search for an element in an array in JavaScript ? When using the indexOf method , if the value is found, it returns the index representing the array element. If the value is not…