Tag: C#
Postfix and Prefix Operator in C#
Below is a sample code snippet demonstrating the Postfix and Prefix Operator in C#
Launch the Bluetooth Settings App using URI Scheme in Windows Phone 8
Below is a sample code snippet demonstrating how launch the Bluetooth Settings app via the URI Scheme and LaunchUriAsync method in Windows Phone using C#. Launch the Bluetooth Settings App using URI Scheme in Windows Phone 8
How to List out only Even Numbers from a List of Integers using Lambda Expression in C#?
Below is sample code snippet that demonstrates how to list out only even numbers from a list of integers using Lambda Expression in C#. How to List out only Even Numbers from a List of Integers using Lambda Expression in C#?
How to prevent the class from being inherited in C#?
How can one prevent the class from being inherited by another class using c#? It’s simple, mark the class as “sealed”. How to prevent the class from being inherited in C#?
Why is C# Main Method static ?
Why is C# Main Method static ? – One of the most frequently asked question if you are a beginner to C# isn’t it ? The Main Share method in the Program.cs looks like this using System; using System.Collections.Generic; using System.Linq; namespace ConsoleApplication1 { class Program cheap NFL jerseys { ??????????????????????????????3P????? WHEELHOUSE static void Americans Main(string[] args) wholesale jerseys { Console.WriteLine(“Hello World”); ??????? } }…
How to Declare Array of Objects in C# ?
Do you want to declare an array of objects in your C# application ? . Below is a sample code snippet that demonstrates how to declare an integer array in C#. How to Declare Array of Objects in C# ?
How to embed quotes inside string in C# ?
If you want to embed quotes within a string in C# , you can use the escape sequence \ followed by the double quotes. How to embed quotes inside string in C# ? Below is a sample sourcecode demonstrating How to embed quotes inside string in C# .
How to Get the Dictionary Key by value in C# ?
If you want to get the Key of a dictionary based on the value in C# , you can use the LINQ’s where clause o FirstOrDefault method. How to Get the Dictionary Key by value in C# ?
Fully Qualified Name in NameSpace
When accessing a class in C# , you use the fully qualifies Name of the class along with the NameSpace . The Fully Qualified Name indicates the logical hierarchy of the class . Below is the sample code that demonstrates the Fully Qualified Name namespace ConsoleApplication4 { internal class Program { private static void Main(string[] args) { System.Console.WriteLine(“This is a…
Pass by Value by default
By default , the Value type (Data types) are pass by value . Below is a sample sourcecode that demonstrates the pass by value .
Using block for SQLConnection in C#
The using statement in C# can also be used to ensure that the resources are automatically cleaned before the using block exits. One of the criteria of the Using statement is that the items being created in the using statement must implement IDisposable interface. For example, you can use the using block to open the SQL Connection, retrieve the data. Using block for SQLConnection in…
How to Get the Last Element from LINQ Query in C#?
Below is a sample source code demonstrating How to Get the Last Element from LINQ Query in C#? How to Get the Last Element from LINQ Query in C#?
How to List Odd Numbers from a List of Integers using Lambda Expression in C#?
Are you looking out for a simple logic to retrieve the odd numbers from the list of integers using Lambda Expression in C#? Below is a sample code snippet demonstrating how to do it. How to List Odd Numbers from a List of Integers using Lambda Expression in C#?
How to Convert a String to Byte Array in C#?
Below is a sample code snippet demonstrating the conversion of string to Byte Array in C#. How to Convert a String to Byte Array in C#?
How to Launch the Application Details Page in Windows Phone Store using C#?
The Windows Phone 8 SDK provides the MarketplaceDetailTask which lets the users to launch the specified application’s details page in the Windows Phone Store from the Windows Phone App. How to Launch the Application Details Page in Windows Phone Store using C#? Below is a sample code snippet that demonstrates how to use the MarketplaceDetailTask. Modify the Content Identifier to specify the app for which…
How to check the Equality of Anonymous Types in C#?
The Equals method is used to check the equality. The anonymous types will be equal of it has the same order, type, name and values. How to check the Equality of Anonymous Types in C#? Below is a sample sourcecode demonstrating how to check the Equality of Anonymous types in c#.
iText Library for Creating PDF documents in C# and Java
iText is a PDF Library or API (Application Programming Interface ) that allows the developers to generate PDF documents based on the data from database or XML file. iText is available in Java as well as .NET (C#) and uses LDF’s many interactive features. iText library allows the developers to add bookmarks , page numbers and watermarks. Know more about iText Library for Creating PDF…
How to Create DataTable and add rows in C#?
Below is a sample code snippet demonstrating how to create DataTable in C# and then add rows to the datatable. How to Create DataTable and add rows in C#?