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.
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.
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.
A PRIMARY KEY constraint in SQL Server is a field or column which ensures that each entry in a table is must be unique and not null.
A primary key can be created at the column or table level. The following is an example to illustrate this:
Last updated on March 4th, 2024 at 02:11 am In the previous article, we learned about the delegates and their …
An anonymous method in C# is a method that doesn’t have a name. You can create an anonymous method using the delegate keyword and assign it to a variable of delegate type.
In this article, We will discuss about the Anonymous method with multiple 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).
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.
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 : 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.
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.
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.
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.
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.
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.
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.
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.
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.
Last updated on March 13th, 2023 at 07:28 pm A constructor in C# is a special method used to initialize …
In C#, the keywords static
, const
, readonly
, and static readonly
are frequently used, but they can be confusing. Today, we will discuss these keywords and use some examples to better understand them.
Here is an article that explains the difference between ref and out keywords in C# with multiple code examples.
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.