Tag: tips

How to change the ‘Edit Top 200 Rows’ in SQL Management Studio ?

When working with the SQL Server Management Studio and trying to edit the table records , you would have noticed the context menu option “Edit Top 200 Rows”. How do you change this to display all the records for editing instead of “Edit top 200 rows” in the context menu ? There are couple of ways in which you can do it. 1. Right click…

How to change Language Version from C# 6.0 in Visual Studio 2015 ?

There are times when you are developing .NET Project in Visual Studio 2015 with C# 6.0 enabled and you might also have members in your team using Visual Studio 2013 and still want to build and run the project. How to change Language Version from C# 6.0 in Visual Studio 2015 ? You can change the C# language version from the project properties. In the…

DateTime and Null value in C#

Assume that you want a variable of type DateTime and you would like to have the uninitialized value or null value , you can use the nullable DateTime type. DateTime and Null value in C# When you define a DateTime variable and dont initialize it , the default value is the DateTime.MinValue. You can simply define the type as Nullable DateTime as shown in the…

How to shutdown or reboot Windows machine from command line in Windows 10 ?

You can reboot a windows machine or shutdown it from the command line in Windows 10 using some of the built-in commands. How to shutdown or reboot Windows machine from command line in Windows 10 ? To shutdown the windows machine , we can use the following command. shutdown /s Similarly , you can reboot or restart the windows machine using the following command shutdown…

C Program to display Positive factors of a number

Problem Write a program in C to display all the positive factors of a number enter by the user. How to find and display positive factors of a number in C ? Below is a program in C demonstrating how to do it. Output Abundantcode.com coding sample Enter a Number :5 Positive factors of the number 5 are below: 1 5

How to Check for NULL value in a Query in SQL Server ?

You might want to check if a column contains a NULL value or NOT and filter the rows. You can use the IS NULL and IS NOT NULL keywords in SQL Server to perform the NULL check. How to Check for NULL value in a Query in SQL Server ? The NULL values cannot be easily identified using the = operator because the NULL refers…

How to add Items to ListBox control in Xaml ?

You can add the Items to a List Box control in Xaml using the Items property . The Items property is an ItemCollection which implements IList. How to add Items to ListBox control in Xaml ? Below is a sample code snippet demonstrating the adding of the Items to ListBox in Xaml of a Windows 10 UWP App. The above showed how to add items…

How to get all the column names of a table in SQL Server ?

If you have a scenario where you need to get all the column names of a table in SQL Server , you can query the database’s INFORMATION_SCHEMA.Columns table by specifying the table name. How to get all the column names of a table in SQL Server ? Here’s a query to demonstrate how to achieve this. This would display all the columns of the table…

How to open display settings from command line in Windows 10 ?

The display properties can be found in the settings app in Windows 10 which lets the users to configure the look and feel of the windows desktop. For example , you can change the display resolution , change wallpaper or screensaver etc. How to open display properties from command line in Windows 10 ? You can open the display settings screen by right clicking on…

How to find the duplicate records on certain fields in SQL Server ?

You can use the group by and having clause in your T-SQL query to find out the duplicate records from the table. How to find the duplicate records on certain fields in SQL Server ? Lets have a look at the query that uses the group by and having clause on the Person table in the AdventureWorks database. The firstname column is used as the…

GOTO Label in SQL Server

There are times when you want to jump to a specific section (Label) in the code when a condition satisfies. You can create a label and then use the GOTO statement to branch directly to the code. To create a label , simply specify the label name followed by the colon. Label1: Here’s a query demonstrating the usage of the Label named “RecordExistsLabel” and GOTO…

How to pass a function as parameter in JavaScript ?

There are times when you might want to pass a function as argument to another function in JavaScript. The function keyword can work in multiple ways. It can act as a operator and a statement as well. Additionally , you can create an expression as well. How to pass a function as parameter in JavaScript ? We can pass a function as a parameter to…

How to remove a column from an existing table in SQL Server?

Use the DDL (Data definition language) query to remove a column from an existing table in SQL Server. How to remove a column from an existing table in SQL Server? ALTER command will allow the user to remove a column from the table. Syntax to remove the column from the table. ALTER TABLE <tablename> DROP COLUMN <columnname>; For example , assume that you have a…

How to Disable Browser Link in Visual Studio 2015 ?

Browser Link is one of the cool features in Visual Studio for the ASP.NET Developers. Sometimes , the web developers might want to disable this feature for various reasons. How to Disable Browser Link in Visual Studio 2015 ? There are 2 ways in which you can disable the Browser link in Visual Studio 2015. 1. Using Web.config file Just set the property vs:EnableBrowserLink value…

How to get the total number of items in a Enum in C# ?

If you want to get the total number of items that is defined in an enum using C# , you can use the Enum.GetNames static method combined with the Length property. How to get the total number of items in a Enum in C# ? Here’s a code sample demonstrating how to do it. This would display 3 in the console.

Commenting Code in PowerShell

This short article will explain in simple steps on how to comment the code in PowerShell. How to Comment Code in PowerShell ? You can use the # symbol to provide a comment in PowerShell. The newer version of PowerShell provides additional options for commenting with the help of <# #> block . This block can be used generally for the help comments. Visit PowerShell…