Tag: How to
How to Convert XmlDocument to XDocument in C# ?
If you want to convert an XmlDocument to XDocument in C# , you can use the XmlNodeReader which does the conversion for you. Use the MoveToContent method and load it to the XDocument class. How to Convert XmlDocument to XDocument in C# ?
SQL Server 2014 Tutorial – Install SQL Server 2014 on Windows 10 machine
Problem Statement You need to install SQL Server 2014 Express edition on Windows 10 machine. Solution There are several ways in which you can install SQL Server. These includes options via command prompt, unattended, server core etc. In this tutorial, we will explore the simplest method using the SQL Server 2014 Setup wizard. Follow the below steps to install SQL Server 2014 1. Download SQL…
How to Get the Property value using reflection in C# ?
Below is a sample method that demonstrates how to retrieve the property value in C# using reflection. How to Get the Property value using reflection in C# ?
How to Get the Last N Elements from a List using LINQ in C#?
Below is a sample code snippet demonstrating how to retrieve last N Elements (2) from a list in C# using LINQ.
How to Hide Status Bar in Windows Phone 8.1 Windows Runtime Apps ?
Below is a sample code snippet that demonstrates how to hide the Status Bar in Windows Phone 8.1 Windows Runtime Apps using C# . How to Hide Status Bar in Windows Phone 8.1 Windows Runtime Apps ?
How to detect if the Windows Phone App is running in KidsCorner using C#?
Below is a sample code snippet that demonstrates how to detect if the application in Windows Phone is running in Kids Corner using C#? The Windows.Phone.ApplicationModel.ApplicationProfile returns the value Default or Alternate. The default value indicates the normal mode whereas the Alternate indicates the Kids Corner mode. How to detect if the Windows Phone App is running in KidsCorner using C#?
Iterating a List of Integer using GetEnumerator , MoveNext and Current in C#
Below is a sample code snippet that demonstrates the usage of the GetEnumerator , and MoveNext to iterate through a list of integers in C#. Iterating a List of Integer using GetEnumerator , MoveNext and Current in C#
How to Copy Image from Assets folder to localstorage in Windows 10 ?
If you want to copy a file or image from a folder to localstorage in Windows 10 , you can use the CopyAsync method of the StorageFile class to do it. How to Copy Image from Assets folder to localstorage in Windows 10 ?
SQL Server 2014 Tutorial – Manage SQL Server services
Problem Statement You need to manage the SQL Server services that are installed on your server machine. Solution Use SQL Server Configuration Manager tool to manage the SQL Server services on your machine. Following are some of the actions that you can perform using the SQL Server Configuration Manager – Start , Stop , Pause , Restart a SQL Server Service – Modify or configure…
How to validate a user in Active Directory using C#?
Do you want to validate a user with the login credentials like username and password of the user in Active Directory using C#? You can do it using the classes provided in the Directory Services namespace. You need to include the assemblies “System.DirectoryServices” and “System.DirectoryServices.AccountManagement” in your solution. How to validate a user in Active Directory using C#? Below is a sample code snippet demonstrating…
How to reverse a string in C#?
Below is a sample code snippet demonstrating on how to reverse a string in C#? How to reverse a string in C#?
How to Declare and Define an Char data type variable in F# ?
How to Declare and Define an Char data type variable in F# ?
How to Launch Map Application in Windows Phone 8 using C#?
Below is a sample code snippet that demonstrates how to launch the Maps Application in Windows Phone 8 programmatically using C#. How to Launch Map Application in Windows Phone 8 using C#?
Example of Enumeration in C#
Below is a sample code snippet that demonstrates how to declare , define and access the Enumeration in C#. Example of Enumeration in C#
What is Suspension Manager in Windows Phone 8.1 App template ?
When you create a new Windows Phone 8.1 project using the Hub App or Pivot App template , you would notice that it contains a class called “SuspensionManager”. What is Suspension Manager in Windows Phone 8.1 App template ? It is a kind of helper class and provides the necessary properties and methods to load and store the state when the windows phone store app…
Java – How to convert a bool or string value to Boolean in Java ?
Problem Statement You need to convert a boolean value of string value to Boolean type in your java program. Solution Use the Boolean class’s constructor and pass the corresponsing parameter to change it. Below is the sample code snippet demonstrating how to do it. The output of the above program is Abundantcode.com Java Tutorials false false
How to remove non alphanumeric characters (special characters) from a string in C# ?
One of the simplest way to remove non alphanumeric characters from a string is using the regular expressions . Below is a sample code snippet that demonstrates how to delete the non alphanumeric characters from a string in C#. How to remove non alphanumeric characters (special characters) from a string in C# ?
How to Declare an Enumeration with Explicit Values in C# ?
There are times when you want to have a specific values to the enumeration to the enum items . For example , if you need to match particular values from the database or from a web service etc. How to Declare an Enumeration with Explicit Values in C# ? Below is a sample code snippet that demonstrates how to declare an enum with explicit values…
How to get the Names of all the columns from a SqlDataReader object in C# ?
Here’s a simple code snippet that demonstrates how to retreive all the column names from a SqlDataReader object in C#. How to get the Names of all the columns from a SqlDataReader object in C# ?
C# Program to swap two numbers without using temporary variable
Problem Write a program in Visual CSharp to swap two numbers using temporary variable and display the result in the console window. How to swap two numbers in C# without using temporary variable ? Output Abundantcode.com coding sample Enter the First Number : 45 Enter the Second Number : 67 First Number is 67 Second Number is 45