What are the advantages of using session?

The advantages of using session are: A session stores user states and data to all over the application. It is very easy to implement and we can store any kind of object. It can store every user data separately. Session is secure and transparent from user because session object is stored on the server. In … Read more

What is the meaning of Immutable?

Immutable means once you create a thing, you cannot modify it. In the context of .NET and programming in general, immutability refers to the characteristic of an object whose state cannot be modified after it is created. Once an immutable object is created, its state remains constant throughout its lifetime. Here’s a more detailed breakdown: … Read more

What is the difference between Hash table and Array list?

Hash table stores data in the form of value pair and name while Array list stores only values. You need to pass name to access value from the Hash table while in Array, you need to pass index number to access value. In Array, you can store only similar type of data type while in … Read more

How to retrieve user name in case of Window Authentication?

System.Environment.UserName. In a .NET interview, if you’re asked how to retrieve the username in the case of Windows Authentication, you would typically use the WindowsIdentity class in conjunction with WindowsPrincipal. Here’s the correct approach: csharpCopy code using System; using System.Security.Principal; class Program { static void Main() { // Retrieve the current Windows identity. WindowsIdentity identity … Read more

What are differences between function and stored procedure in .Net programming language?

The difference between function and stored procedure: Function returns only one value but procedure can return one or more than one value. Function can be used in select statements but procedure cannot be used. Function has only input parameters while Procedure can have an input and output parameters. Exceptions can be handled by try catch … Read more