Category: C#

Json.NET & Oxygene – How to Serialize a Collection?

Do you want to serialize an collection in your Remobjects Oxygene.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 Oxygene.NET using Json.NET library ? For example , assume…

How to get the Computer Name in C# ?

When working on a Winforms or Console application using C# , sometimes you might need to get the computer name where the application is running. How to get the Computer Name in C# ? To retrieve the computer name , one can use the System.Environment.MachineName property as shown below.

How to Add item to the beginning of List in C# ?

If you want to add or insert an item to the beginning of the List in C# , you can use the Insert method defined in the collection as shown below. How to Add item to the beginning of List in C# ? using System; using System.Collections.Generic; using System.Linq; namespace ACCode {     class Program     {         static void Main(string[] args)         {            …

How to handle Null Column values of SQLDataReader in C# ?

If you want to handle the Null column values of the sqldatareader object in C#, you can use the SqlReader.IsDBNull method to validate for it. If the SqlReader.IsDBNull returns true then , the value is considered to be a null value and you can take the ction accordingly. How to handle Null Column values of SQLDataReader in C# ?