Tag: tips

Example of Property Elements in Xaml

The Syntax for the property element in Xaml is as follows below TypeName.PropertyName The property elements are always contained inside a typename object and they don’t have the attributes of their own. An example of the property element is the Button.Content property which is used to set the content of the button control which is of type object. The Below code is used to set…

using IN clause to provide a list of values for Search Criteria

In SQL Server , you can use the IN clause to providing the list of values for a search criteria. For example , you want to display the employee records who’s job title is one of the following : ‘Design Engineer’,’Tool Designer’. The above query uses the IN clause to filter the employee records using the arbitrary list of values. Alternatively , you can also…

C Program to print a Half Pyramid using *

Problem Write a program in C to print Half pyramid using * as shown. * * * * * * * * * * * * * * * How to create and display Half Pyramid pattern in C ? Output Abundantcode.com Coding samples Enter the total number of rows: 5 * * * * * * * * * * * * * *…

Exit the Current Scope without returning a value in SQL Server

You can use the RETURN statement to discontinue the execution of a the T-SQL batch statement. For example , you want to display the Employees whose MaritalStatus is Divorced. You donot want the SQL Statements following it to be executed if this condition doesn’t match. You can use the IF NOT EXISTS and use the RETURN statement as shown in this example. The second statement…

Inner Join in SQL Server

You can use inner join to get the result of two tables that match the criteria. For example , assume that you have a Person table and a Phone Number table where every person would have 0 or more phone number associated to him and you wish to get the person records who have at least one phone number. Here’s the query on how to…

How to check if a column exists in a table in SQL Server ?

If you want to find out if a column exists in a SQL Server table , you can use the sys.columns table and specify the name of the column and table as parameter. How to check if a column exists in a table in SQL Server ? For example , you want to find out if the GroupName column exists in the table “HumanResources.Department” table…

Sleep Command in SQL Server

If you are looking at writing a query to sleep for or WAIT for a certain amount of time before the query execution can begin , you can use the WAITFOR command. For example , if you want to wait for 1 minute , the query or command for the same will be this.

Specify a port number when connecting to SQL Server in Management Studio

There are times when you want to connect to a SQL Server instance that is running on a different port number than default port (1433). How to specify a port number when connecting to a SQL Server instance in SQL Management Studio ? Just specify the SQL Server instance that you are connecting to along with the port number with comma as delimiter. For example…

How to remove or replace array element in JavaScript ?

To remove or replace an element in an array in JavaScript , you can use the splice method as shown below. How to remove or replace array element in JavaScript ? To remove the array element , you can use the splice method and specify the index of the array to remove the array element. The second parameter determines the number of elements to remove….

How to mark a file as read-only from command line in Windows 10 ?

You can set a file to a read-only mode from the command line by using the command attrib and passing in the parameters like the read-only mode and the name of the file. The format of this command is as follows attrib +R  <Name of the the file> How to mark a file as read-only from command line in Windows 10 ? For example ,…

How to Get the Current Location in Windows Phone 8?

The Windows Phone 8 SDK provides the Geolocator class which can be used to monitor and get the current location from Windows Phone 8. The Geolocator API is part of the WinPRT API and contains the necessary events for detecting the changes in the Geographic position of the Windows Phone. Below is a sample soucrecode demonstrating how to get the Current Location in Windows Phone…

Sorting the Data in a Query in SQL Server

You want the results of the query to be displayed in a sorted order based on some query. In this case , you use the ORDER BY clause in the query by specifying the column on which the sort to work. For example , you want to sort the Departments table in the database by the column DepartmentName. Here’s how the query looks like This…