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 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#?

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…

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

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