Tag: tricks

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.

FSharp Interactive Commands

FSharp Interactive UI includes few good number of commands which can be used by the F# Developers . Below are some of the FSI Commands which can be used by the developers. FSharp Interactive Commands Cancel Interactive Evaluation – This option cancels the execution of the FSI . Reset Interactive Session – This option resets the execution of the current FSI . Cut – This…

How to get specific columns from a Table in SQL Query ?

If you want to get the data from the specific columns from a table in your database , you can specify them in the query. For example, This would return the data of all the columns available in the Department table. If you want to get the data of the specific columns from the Department table , you can specify the column names in the…

How to Get the List of Appointments from the Calendar App in Windows Phone using C# ?

If you want to programmatically get the list of appointments from the calendar application of your Windows Phone device programmatically , you can use the Microsoft.Phone.UserData.Appointments. How to Get the List of Appointments from the Calender App in Windows Phone using C# ? Enable the ID_CAP_APPOINTMENTS in the WMAppManifest file and then create an instance of the Appointments class and call the SearchAsync method with…