Properties In C# With Examples: ReadOnly, WriteOnly Properties in C#

Property in C# is a member of a class that allows classes to read, write, and expose private fields while keeping the implementation details hidden.

In this post, we will try to understand how to use properties in C# with multiple examples.

Properties in CSharp
Properties in C#

Read more >>

Var keyword in C#: Best Practices and Examples

VAR Keyword in C#
VAR Keyword in C#

Introduction: var keyword in C#

In C# 3.0, the var keyword was introduced to declare an implicit type local variable that could hold any data. However, it’s important to remember that when using var, you must ensure the variable is assigned a value during declaration.

In simpler terms, var lets us create a variable without deciding its type beforehand. It’s like telling the compiler, “Hey, you decide the type based on what value I assign to this variable.” However, it’s important to note that when we declare a variable with var, we must also initialize it with a value right at the beginning.

Read more >>

Understanding C# Delegates (with Examples)

In simple terms, a delegate in C# is like a pointer to a method. It allows you to refer to a method by its name and invoke it later. Think of it as a “method container” that holds a reference to a particular method with a specific signature (parameters and return type).

Delegates In C#
C# delegate

Read more >>

Stored Procedure In SQL Server| Types Of Stored Procedure In SQL

types-of-stored-procedure-in-sql-server
types-of-stored-procedure-in-sql-server

In this article, we will discuss how to create a stored procedure in a SQL Server database. Also, we will try to understand the different types of stored procedures available in SQL Server through various examples.

What Is a Stored Procedure In SQL Server?

Read more >>

CREATE, ALTER, AND DROP DATABASE IN SQL SERVER

In this article, we will discuss how to Create, Alter, and Drop a database in SQL Server.
In my previous article, we have discussed all about the Types of SQL Commands.

Database Introduction

 Database  : In the SQL server a database is a place to store the data in an electronic format. It is an organized collection of database objects such as tables, views, functions, stored procedures, triggers and so on.
It allows a user to easily access or manipulate the data.

SQL server database

Create Database In SQL Server

In SQL Server, there are two ways to create a user-defined database, either by using the Transact-SQL statements or by using SQL Server Management Studio.

Read more >>

5 Types of SQL Commands: DML, DDL, DCL, TCL, DQL with Query Example

SQL commands are a set of instructions used for interacting with relational database management systems (RDBMS).

SQL (Structured Query Language) is the standard language for managing and manipulating data in databases like SQL Server, MySQL, Oracle, Sybase, and Postgres.

Here, We will learn SQL commands like DML, DDL, DCL, TCL and DQL commands in SQL with examples.

image-types of SQL Commands
Types of SQL Commands

Read more >>

Lock keyword in C# | Thread Locking In C#

The lock keyword in C# is used to place around a critical section of code, where we want to allow only one thread to access the resource at a time. Any other thread cannot access the lock and it waits for the lock to be released.

In this post series, we will go through the understanding of the lock keyword,  monitor, mutex, and semaphore available in C#.

All of these classes (lock, monitor, mutex, and semaphore) provide a synchronization mechanism to protect the shared code or resources in a multithreaded application.

CSharp Lock keyword in multithreading
C# Lock keyword

Read more >>

Multithreading in C#

In C#, multithreading is the ability of a central processing unit (CPU), or a single-core or multi-core processor, to execute multiple threads concurrently. This allows the program to perform multiple tasks simultaneously, making the program more efficient and responsive.

Multithreading in CSharp
Multithreading in C#

Read more >>

C# Reflection: Everything You Need to Know about Reflection in C# (With Examples)

Reflection in C# is the process of retrieving metadata of types, modules, assemblies, and more during runtime. With reflection, you can dynamically create an instance of a type, associate a type with an existing object, obtain the type of an existing object, and call its methods, fields, and properties.

In this article, we will explore the concept of C# Reflection, its hierarchy, when to use it, and some examples of its implementation.

C# Reflection
Reflection in C#

Read more >>

C# Private Constructor (with example)

A Private Constructor is an instance constructor used to prevent creating an instance of a class if it has no instance fields or methods. It is used in classes that contain only static members.

In this article, we will explore the concept of a private constructor, its uses, and how it can be implemented in C# programming.

CSharp Private Constructor
C# Private Constructor

Read more >>

Copy Constructor in C# with Code Examples

Introduction

In object-oriented programming, a copy constructor plays a crucial role in creating a new object by copying the variables from an existing object. 

Copy constructor allows us to initialize a fresh instance with the values of an already existing instance. Although C# doesn’t inherently provide a copy constructor, we can create one according to our specific requirements.

In this article, we’ll try to understand the concept of Copy constructors in C# with examples.

Copy Constructor in C#
Copy Constructor in C#

Read more >>

C# Static Constructor (with Examples)

A static constructor is a method that initializes static data members of a class or executes a specific task that needs to be done only once. This constructor is automatically invoked before the first instance of a class is created, or any static data members are accessed.

In this post, We will learn about the C# static constructor with multiple examples.

CSharp Static Constructor
C# Static Constructor

Read more >>

C# String VS StringBuilder | Top 5 Differences between string and StringBuilder

In C#, a string is an immutable data type, which means it cannot be altered once created in the heap memory. On the other hand, StringBuilder is a mutable data type that can be modified. When operations like string concatenation are performed on a StringBuilder object, it does not create a new instance in the heap memory every time, unlike a string.

This article will teach the Difference between string and StringBuilder in C# with multiple code examples.

C# string vs stringbuilder
C# String VS StringBuilder

Read more >>