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…

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

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 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…

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…