Tag: C#
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#?
How to List out Even Numbers from a List of Integers using LINQ in C#?
Below is sample code snippet that demonstrates how to list out only even numbers from a list of integers using LINQ? How to List out Even Numbers from a List of Integers using LINQ in C#?
Example of Immediate Query Execution of LINQ in C# .NET
Below is a sample code snippet that demonstrates the Immediate Query execution of LINQ Query in C#. Example of Immediate Query Execution of LINQ in C# .NET The Output of the above program in
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#?
C# and LINQ – Finding all the elements of an integer array less than 35
Here’s a sample code snippet demonstrating how to find all the elements of an integer array that is less than 35 using LINQ in C#. The where keyword in C# is used to filter the elements from a collection based on the specified criteria. Ensure that you import the System.Linq namespace to your C# code. How to find all the elements of an integer array…
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#
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# ?
How to find if the Year is Leap Year or Not in C# ?
Below is a sample code snippet that demonstrates how to find if the year is a leap year or not. How to find if the Year is Leap Year or Not in C# ?