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…
var keyword in For Statements in C#
Below is a sample sourcecode demonstrating the usage of the var keyword within the indexes in the for statement in c#. var keyword in For Statements in C#
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.
C# Compiler Error – CS0439 an extern alias declaration must precede
In this blog post, you’ll learn more about the C# Compiler Error – CS0439 and the related message description C# Compiler Error Code CS0439 C# Compiler Description for the Code :CS0439 An extern alias declaration must precede all other elements defined in the namespace
C# Compiler Error – CS1770 a value of type ‘{0}’ cannot be used as
In this blog post, you’ll learn more about the C# Compiler Error – CS1770 and the related message description C# Compiler Error Code CS1770 C# Compiler Description for the Code :CS1770 A value of type ‘{0}’ cannot be used as default parameter for nullable parameter ‘{1}’ because ‘{0}’ is not a simple type
C# Compiler Warning – CS8610 nullability of reference types in type o
In this blog post, you’ll learn more about the C# Compiler Warning – CS8610 and the related message description C# Compiler Warning Code CS8610 C# Compiler Description for the Code :CS8610 Nullability of reference types in type of parameter ‘{0}’ doesn’t match overridden member.
C# Compiler Error – CS1949 the contextual keyword ‘var’ cannot be u
In this blog post, you’ll learn more about the C# Compiler Error – CS1949 and the related message description C# Compiler Error Code CS1949 C# Compiler Description for the Code :CS1949 The contextual keyword ‘var’ cannot be used in a range variable declaration
C# Compiler Error – CS8309 cannot compile net modules when using /r
In this blog post, you’ll learn more about the C# Compiler Error – CS8309 and the related message description C# Compiler Error Code CS8309 C# Compiler Description for the Code :CS8309 Cannot compile net modules when using /refout or /refonly.
C# Compiler Error – CS8870 ‘{0}’ cannot be sealed because containin
In this blog post, you’ll learn more about the C# Compiler Error – CS8870 and the related message description C# Compiler Error Code CS8870 C# Compiler Description for the Code :CS8870 ‘{0}’ cannot be sealed because containing record is not sealed.
How to Search for an App in Windows Phone Store using URI Scheme from WP8 App?
Below is a sample code snippet demonstrating Search for an App in Windows Phone Store using URI Scheme from WP8 App How to Search for an App in Windows Phone Store using URI Scheme from WP8 App?
C# Compiler Warning – CS1927 ignoring /win32manifest for module becau
In this blog post, you’ll learn more about the C# Compiler Warning – CS1927 and the related message description C# Compiler Warning Code CS1927 C# Compiler Description for the Code :CS1927 Ignoring /win32manifest for module because it only applies to assemblies
C# Compiler Error – CS4028 ‘await’ requires that the type ‘{0}’ hav
In this blog post, you’ll learn more about the C# Compiler Error – CS4028 and the related message description C# Compiler Error Code CS4028 C# Compiler Description for the Code :CS4028 ‘await’ requires that the type ‘{0}’ have a suitable ‘GetAwaiter’ method. Are you missing a using directive for ‘System’?
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) { …
C# Compiler Error – CS1774 embedded interop method ‘{0}’ contains a
In this blog post, you’ll learn more about the C# Compiler Error – CS1774 and the related message description C# Compiler Error Code CS1774 C# Compiler Description for the Code :CS1774 Embedded interop method ‘{0}’ contains a body.
C# Compiler Error – CS8208 it is not legal to use the type ‘dynamic
In this blog post, you’ll learn more about the C# Compiler Error – CS8208 and the related message description C# Compiler Error Code CS8208 C# Compiler Description for the Code :CS8208 It is not legal to use the type ‘dynamic’ in a pattern.
C# Compiler Error – CS1022 type or namespace definition, or end-of-
In this blog post, you’ll learn more about the C# Compiler Error – CS1022 and the related message description C# Compiler Error Code CS1022 C# Compiler Description for the Code :CS1022 Type or namespace definition, or end-of-file expected
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# ?
C# Compiler Warning – CS8775 member ‘{0}’ must have a non-null value
In this blog post, you’ll learn more about the C# Compiler Warning – CS8775 and the related message description C# Compiler Warning Code CS8775 C# Compiler Description for the Code :CS8775 Member ‘{0}’ must have a non-null value when exiting with ‘{1}’.
C# Compiler Error – CS1942 the type of the expression in the {0} cl
In this blog post, you’ll learn more about the C# Compiler Error – CS1942 and the related message description C# Compiler Error Code CS1942 C# Compiler Description for the Code :CS1942 The type of the expression in the {0} clause is incorrect. Type inference failed in the call to ‘{1}’.
C# Compiler Error – CS0227 unsafe code may only appear if compiling
In this blog post, you’ll learn more about the C# Compiler Error – CS0227 and the related message description C# Compiler Error Code CS0227 C# Compiler Description for the Code :CS0227 Unsafe code may only appear if compiling with /unsafe