c#   Blogs & Tutorials

58 blogs found

Understanding Memory Management and Garbage Collection in .NET

In this blog post, we will explore the essential concepts of memory management and garbage collection in .NET, focusing on how these features work in C#. You'll learn about the significance of memory management, the role of the garbage collector, and best practices to optimize memory usage in your applications.

Understanding Abstract Classes in C#: A Comprehensive Guide

In this blog post, we will explore the concept of abstract classes in C#, how they are defined, and why they are essential in object-oriented programming. You'll learn how to implement abstract classes with practical code examples, and discover best practices to avoid common pitfalls.

LINQ

LINQ (Language Integrated Query) is a feature in C# that allows us to perform queries against data sources, which can be arrays, collections, or any type of databases, using a SQL-like syntax. In this article, we will cover some basic concepts and functionalitites of LINQ and learn how to use it in your C# application

Threading in C#

Threading is an important aspect of programming that allows developers to perform multiple tasks at the same time. In C#, threading is an efficient way to run multiple pieces of code concurrently.

Destructor

Destructor is opposite of constructor.It is used to destructs automatically the instance of the constructor class.it is defined one time in the class.

Lists

C# List class is used to store and fetch elements. It can also have duplicate elements. It is found in System.Collections.Generic namespace. List class in C# represents a strongly typed list of objects. List provides functionality to create a list of objects, find list items, sort list, search list, and manipulate list items. In List, T is the type of object. What is the ‘T’ in List? List class represents a strongly typed list of objects. List provides functionality to create a list of objects, find list items, sort list, search list, and manipulate list items. In List, 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 class. using System.Collections.Generic; The List 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.

If Else Statement

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.

foreach Loop

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.

While Loop

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.

Create JSON String in C#

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.

C# Regex Examples

The Regex class in C# is part of the System.Text.RegularExpressions namespace. It provides a way to work with regular expressions, allowing you to perform pattern matching and manipulation of text. Here are some common operations you can perform using the Regex class:

C# collection

For many applications, you want to create and manage groups of related objects. There are two ways to group objects: by creating arrays of objects, and by creating collections of objects. Arrays are most useful for creating and working with a fixed number of strongly typed objects. For information about arrays, see Arrays.

The report definition is not valid or is not supported by this version of reporting

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.

Translate Page