What is the difference between Finalize and Dispose?

Class instances often encapsulate control over resources that are not managed by the runtime, such as window handles (HWND), database connections, and so on. Therefore, you should provide both an explicit and an implicit way to free those resources. Provide implicit control by implementing the protected Finalize Method on an object (destructor syntax in C# and the Managed Extensions for C++). The garbage collector calls this method at some point after there are no longer any valid references to the object. In some cases, you might want to provide programmers using an object with the ability to explicitly release these … Click here to continue reading.

What are the different types of locks?

SQL Server uses these resource lock modes. Lock mode Description Shared (S) Used for operations that do not change or update data (read-only operations), such as a SELECT statement. Update (U) Used on resources that can be updated. Prevents a common form of deadlock that occurs when multiple sessions are reading, locking, and potentially updating resources later. Exclusive (X) Used for data-modification operations, such as INSERT, UPDATE, or DELETE. Ensures that multiple updates cannot be made to the same resource at the same time. Intent Used to establish a lock hierarchy. The types of intent locks are: intent shared (IS), … Click here to continue reading.

What is difference between canche.insert and cache.add method

The Add and Insert methods have the same signature, but there are subtle differences between them. First, calling the Add method returns an object that represents the cached item, while calling Insert does not. Second, their behavior is different if you call these methods and add an item to the cache that is already stored there. The Insert method replaces the item, while the Add method fails.

What is the difference between Virtual function and Pure Virtual function?

A virtual function makes its class a polymorphic base class. Derived classes can override virtual functions. Virtual functions called through base class pointers/references will be resolved at run-time. That is, the dynamic type of the object is used instead of its static type: Derived d;  Base& rb = d;  // if Base::f() is virtual and Derived overrides it, Derived::f() will be called  rb.f(); A pure virtual function is a virtual function whose declaration ends in =0: class Base {   // …   virtual void f() = 0;   // … A pure virtual function makes the class it is defined for abstract. Abstract classes cannot … Click here to continue reading.

What is Globalization and Localization?

Globalization is the process of creating an application that meets the needs of users from multiple cultures. It includes using the correct currency, date and time format, calendar, writing direction, sorting rules, and other issues. Accommodating these cultural differences in an application is called localization.Using classes of System.Globalization namespace, you can set application’s current culture. This can be achieved by using any of the following 3 approaches. Detect and redirect Run-time adjustment Using Satellite assemblies.