C#

C# Blogs & Tutorials

Step-by-step guides, source code examples and in-depth articles

61
Articles
164,009
Total Views
12,898
Top Article Views

Showing 61 of 61 articles

24
Mar
2026
CWE-119: Buffer Overflow - Understanding Memory Buffer Vulnerabilities in C#
4 views

This comprehensive guide delves into CWE-119, focusing on buffer overflow vulnerabilities in C#. Readers will gain a deep understanding of how these vulnerabilities arise, their implications, and how to prevent them in production code. A solid grasp of memory management and C# programming is recommended to fully benefit from this post.

09
Dec
2023
Complete Guide to Lists in C#: Examples and Best Practices
3,208 views

C# List<T> class is used to store and fetch elements. It can also have duplicate elements. It is found in System.Collections.Generic namespace. List<T> class in C# represents a strongly typed list of objects. List<T> provides functionality to create a list of objects, find list items, sort list, search list, and manipulate list items. In List<T>, T is the type of object. What is the ‘T’ in List<T>? List<T> class represents a strongly typed list of objects. List<T> provides functionality to create a list of objects, find list items, sort list, search list, and manipulate list items. In List<T>, T is the type of objects. How to create List in C#? List is a generic class and is defined in the System.Collections.Generic namespace. You must import this namespace in your project to access the List<T> class. using System.Collections.Generic; The List<T> is a generic collection, so you need to specify a type parameter for the type of data it can store. The following example shows how to create a list and add elements.

09
Dec
2023
If Else Statement
3,470 views

In C# if-else statement also tests the condition. It executes the if block if the condition is true otherwise else block, is executed. the else statement to specify a block of code to be executed if the condition is False. the if-else statement checks a Boolean expression and executes the code based on if the expression is true or false. The if part of the code executes when the value of the expression is true. The else part of the code is executed when the value of the expression is false.

09
Dec
2023
Mastering the foreach Loop in C#: A Complete Guide with Examples
3,131 views

The foreach loop in C# executes a block of code on each element in an array or a collection of items. When executing foreach loop it traversing items in a collection or an array. The foreach loop is useful for traversing each item in an array or a collection of items and displayed one by one. the foreach loop when working with arrays and collections to iterate through the items of arrays/collections. The foreach loop iterates through each item hence called foreach loop.

09
Dec
2023
Mastering While Loops in C#: A Complete Guide with Examples
3,243 views

C# provides the while loop to repeatedly execute a block of code as long as the specified condition returns false. The while loop starts with the while keyword, and it must include a boolean conditional expression inside brackets that returns either true or false. It executes the code block until the specified conditional expression returns false. The condition is given in the beginning of the loop and all statements are executed till the given boolean condition satisfies when the condition becomes false, the control will be out from the while loop else It executes the code block until the specified conditional expression returns false.

31
May
2023
Create JSON String in C#
4,542 views

JSON (JavaScript Object Notation) is a lightweight data interchange format commonly used for transmitting data between multiple systems, mostly in Web APIs and client applications. JSON is a text-based format that is easy for humans to read and write and also easy for machines to parse and generate. It is language-independent, meaning it can be used with any programming language that has the capability to parse JSON data.

02
Jul
2022
The report definition is not valid or is not supported by this version of reporting
10,794 views Video

Hello guys in this article we will see how to solve an exception when you try to use old rdlc report and make changes into that . You will see you will get an exception ReportProcessingException: The report definition is not valid. Details: The report definition has an invalid target namespace 'http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition' which cannot be upgraded. We will see how to solve that.

Code2Night

A community platform for sharing programming knowledge, tutorials, and blogs. Learn, write, and grow with developers worldwide.

Panipat, Haryana, India
info@code2night.com
© 2026 Code2Night. All Rights Reserved.
Made with for developers  |  Privacy  ·  Terms
Translate Page