Tag: How to
How to Find if an Integer Is Even using Bitwise Operator in C# ?
Below is a sample code snippet that demonstrates how to find if an Integer is even using Bitwise Operator in C#. How to Find if an Integer Is Even using Bitwise Operator in C# ?
How do Specify the Exit Code of Console Application in .NET?
There are times when you want to specify the exit code from the Main function for example when working on the Console Application in .NET . How do Specify the Exit Code of Console Application in .NET? You can use the Environment.Exit to specify the exit code in the Console Application.
Using Where clause in T-SQL Query
If you want to restrict the results of the query to only the records that you need instead of returning all the records from the table , you can use the WHERE clause to filter the records. You can simply specify the WHERE clause and also specify the conditions that the rows must meet. How to Filter records using WHERE clause in SQL Server ?…
Using FETCH and OFFSET to get N records in SQL Server
In SQL Server , you can use the OFFSET and FETCH and apply paging and retreive N records at a time. OFFSET AND FETCH clause are part of the ORDER BY clause and hence you must include the ORDER BY clause. For example , you might want to skip the first 4 records and retrieve 5 records from the query , you could use the…
Java – How to create BigDecimal from string value ?
Problem Statement You want to create a BigDecimal value from a string type in Java. Solution Use the BigDecimal class and pass the string value in the constructor to create the BigDecimal value as shown below. The output of the above program is Abundantcode.com Java Tutorials 198654586.297292792
C Program to display the characters from A to Z
Problem Write a program in C to display all the characters from A to Z using Loop constructs. How to display Characters from A to Z using C Programming Language ? Output Abundantcode.com programming sample A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Get the date in YYYY-MM-DD format in SQL Server.
You can retreive the date in the YYYY-MM-DD format in SQL Server using the CONVERT method as shown in this code snippet. How to get the date in YYYY-MM-DD format in SQL Server ?
How to Convert Decimal number to hex in JavaScript?
Below is a sample soucrecode snippet demonstrating the conversion of decimal number to hexadecimal in JavaScript. How to Convert Decimal number to hex in JavaScript?
C Program to compute Quotient and Remainder
Problem Write a program in C to calculate the quotient and remainder and display it on the screen. How to compute quotient and remainder in C ? Output Enter dividend: 8 Enter divisor: 3 Quotient = 2 Remainder = 2
C Program to display Prime Numbers between two numbers
Problem Write a program in C to display all the prime numbers between a range of 2 numbers. How to display prime numbers between a range of 2 numbers in C ? Output Abundantcode.com coding sample Enter Lower limit :5 Enter Upper limit :20 Prime numbers between 5 and 20 : 5 7 11 13 17 19
Java – How to convert String to Double in Java ?
Problem Statement You want to convert a string value to double in Java. Solution You can use one of the three approaches to convert a string to double in Java. 1. Assigning the string to the constructor of the Double class 2. Using Double.valueOf 3. Using Double.parseDouble The output of the above program is Abundantcode.com Java Tutorials 76.2 String to double using valueOf 76.2 string…
How to Notify Clients when there is a change using C# ?
There are times when you want the users who use the class wants some kind of indication or notification when there is a change in data inside it . One of the solutions for this is to make the class implement INotifyPropertyChanged interface which is located in the namespace System.ComponentModel. One of the primary use of the INotifyPropertyChanged is in the WPF / Silverlight /…
How to Catch an Exception in C# ?
Every time when the exception is thrown , it is necessary that it be handled . In this case , one needs to wrap the code with the try catch block as shown below. How to Catch an Exception in C# ?
Encoding.ASCII.GetBytes in F# for Array of Bytes (Ascii string)
Below is a sample code snippet demonstrating the usage of the “B” to define a ASCII string in F# . This technique is somewhat similar to Encoding.ASCII.GetBytes in F#. Encoding.ASCII.GetBytes in F# for Array of Bytes (Ascii string)
How to Validate an email address using Regular Expression in C# ?
You can validate an email address in C# using regular expressions which provides the developers to play around with different patterns. Below is a code snippet that shows how you can use regular expression to validate an email address in C# . How to Validate an email address using Regular Expression in C# ?
How to create drop down list in Microsoft Excel ?
This article will explain how to create drop down list in Microsoft Excel. Drop down list is one of the most commonly used ways in excel to allow users to select the items from the predefined list . The drop down list in Excel allows the users to select only the valid entries. How to create drop down list in Microsoft Excel ? Follow the…
How to remove user from group using command line in Windows 10 ?
You can use the net localgroup command and specify the /delete parameter to remove the user from a group using command line in Windows 10. The format of the command is as shown below. net localgroup <groupname> <username> /delete How to remove user from group using command line in Windows 10 ? 1. Open command prompt from the elevated administrator mode. 2. Enter the command….
Json.NET & C# – How to Serialize a Collection?
Do you want to serialize an collection in your C# 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 C# using JSON.NET ? For example , assume that you…
Alias Names for Tables in SQL Query
There are times when you write query and end up qualifying the columns references by indicating the table name. For example , In the above query , the Department table is referred in the GroupName and Name column. Instead of mentioning the table table , we could provide a shortname or alias name for the table and use the alias name instead. The full use…
How to use Find method with Lambda Expressions in C#?
Below is a sample source code demonstrating how to use Find method with Lambda Expression in C# How to use Find method with Lambda Expressions in C#?