Tag: How to
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.
C Program to convert decimal number to binary
Problem Write a program in C to convert a decimal number to binary number How to convert a decimal number to binary number in C ? Output Abundantcode.com Coding samples Enter a decimal number: 10 1010
Java How to – Compile and run Java program in Command-line
Problem Statement You need to compile and run your java program in command-line. Solution You can use the command-line tools available with Java Development Kit (JDK). The “javac” command tool can be used to compile the java program. The “java” command can be used to run the java program. Let’s build out first program and use the command line to run. 1. Download and install…
How to Launch the Device Bluetooth Settings App from the Windows Phone 8 App?
Below is a sample code snippet that demonstrated how the developers can use the ConnectionSettingsTask launcher to launch the windows phone device’s Bluetooth settings app from the Windows Phone 8 App. How to Launch the Device Bluetooth Settings App from the Windows Phone 8 App?
C# program to print the multiplication table of a given number.
Problem Write a program in Microsoft Visual C# that takes a number as input and prints its multiplication table. Solution Output Abundantcode.com coding sample Enter the Number : 5 5 x 1 = 5 5 x 2 = 10 5 x 3 = 15 5 x 4 = 20 5 x 5 = 25 5 x 6 = 30 5 x 7 = 35 5…
Java – How to convert a double value to string ?
Problem Statement You need to convert a double value to string in your java program. Solution Use the toString() method defined in the Double class to convert a double value to string in java. The output of the above program is Abundantcode.com Java Tutorials 25.0
How to make a Phone Call from a Windows Phone 8.1 App ?
Below is a sample code snippet that demonstrates how to make a call from a Windows Phone 8.1 app in the Windows Runtime App Model. How to make a Phone Call from a Windows Phone 8.1 App ?
C Program to generate multiplication table
Problem Write a program in C to generate a multiplication table of a number entered by the user. How to generate a multiplication table for a input number in C ? Here’s a program that takes an input from the user and generates a multiplication table for it up to 10. Output Abundantcode.com’s Coding sample Enter a Number: 12 12 * 1 = 12 12…
How to Create and Register a Route in ASP.NET MVC ?
The routes for the ASP.NET MVC Web Application is defined in the RouteConfig.cs under the App_Start folder of the ASP.NET MVC 4 Project. The RouteConfig.CS contains the following code. The RouteConfig contains a static RegisterRoutes function which is called from the Global.asax file. The above method in the Global.asax is triggered when the application is started for the first time. How to Create and Register…
Json.NET & VB.NET – How to Serialize an Collection?
Do you want to serialize an collection in your VB.NET application?. Json.NET supports this functionality with ease. The Collection can be an Array , Dictionary or List. You need to simply pass collection to the JsonConvert.SerializeObject static method which would serialize the collection and return you the Json string. How to Serialize a Collection in VB.NET using Json.NET ? For example , assume that you…
C# Program to swap two numbers
Problem Write a program in C# to swap two numbers using temporary variable and display the result in the console window. How to swap two numbers in C# and display it in the Console ? Output Abundantcode.com coding sample Enter the First Number : 25 Enter the Second Number : 87 First Number is 87 Second Number is 25
How to disable Foreign Key constraints using T-SQL in SQL Server ?
You can enable or disable the foreign key constraints for a table in a SQL Server using the ALTER statement. How to disable Foreign Key constraints using T-SQL in SQL Server ? Here’s the T-SQL query to disable all the constraints of the table “Employee”. If you want to enable all the constraints of the table , here’s how you do it.
How to Validate Email Address in JavaScript ?
Here’s a sample JavaScript function that shows how to validate an email address . How to Validate Email Address in JavaScript ?
How to get the list of user names from command prompt in Windows 10 ?
If you want to get the list of users from the command prompt of your Windows 10 local system , you can use the use the command “net user” as shown below. How to get the list of user names from command prompt in Windows 10 ? Open command prompt in Windows 10. Enter the command “net user” and press the enter key. This will…
How to Format a Type with ToString () in C#?
The ToString method of a type will show the type’s name. For example , If the Object is the Employee type , then calling the ToString will display the Type Name along with the name space as shown in the below screenshot. You can override the ToString method to provide you own way to display the data when ToString is called. How to Format a…
Inserting a line break in the NVARCHAR data in SQL Server
For inserting the character break in a data of type NVARCHAR in SQL Server , you can use CHAR(13). Inserting a line break in the NVARCHAR data in SQL Server Inserting a line break in the NVARCHAR data in SQL Server
How to display the string value of a Enum in C# ?
Below is a sample sourcecode that demonstrates how to display the string value of a Enum in C# ?
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…
#time switch to measure the execution time in F#
If you want to measure the execution time of your F# code , you can use the #time attribute which lets you measure the F# code easily.
How to Clone a Generic List in C#?
Below is a sample code snippet that demonstrates how to clone a generic list in C#. How to Clone a Generic List in C#?