Type constructor and instance constructor

Hi ,Can anybody tell me about type constructor and instance constructor?

Yes sure it goes this way we can say that instance constructor is executed when a new instance of type is created and the class constructor is executed after the type is loaded and before any one of the type members is accessed and also class constructors are used for static field initialization.


Is there anyone to tell me the main points about the destructors????????(in numbered form will be easy to understand).

Well My Dear friend in C# you can never call destructor, the reason is one cannot destroy an object.It’s the .Net frameworks Garbage Collector (GC) who has the control over the destructor in C#. GC destroys the objects only when necessary.
Regarding points these are
1. Destructors are invoked automatically, and cannot be invoked explicitly.
2. Destructors cannot be overloaded. Thus, a class can have, at most, one destructor.
3. Destructors are not inherited. Thus, a class has no destructors other than the one, which may be declared in it.
4. Destructors cannot be used with structs. They are only used with classes.
5. An instance becomes eligible for destruction when it is no longer possible for any code to use the instance.
6. Execution of the destructor for the instance may occur at any time after the instance becomes eligible for destruction.
7. When an instance is destructed, the destructors in its inheritance chain are called, in order, from most derived to least derived


Hello, What are advantages of ADO.NET can nybody tell me !!!!!!!

Yes friend the advantage of ADO.Net are
1. ADO.NET Does Not Depend On Continuously Live Connections
2. Database Interactions Are Performed Using Data Commands
3. Data Can Be Cached in Datasets
4. Datasets Are Independent of Data Sources
5. Data Is Persisted as XML
6. Schemas Define Data Structures


Hi,what’s the difference between OLEDB Provider and SqlClient ?

Hello We can say that SQLClient .NET classes are highly optimized for the .net / sqlserver combination and achieve optimal results. The SqlClient data provider is fast. It’s faster than the Oracle provider, and faster than accessing database via the OleDb layer. It’s faster because it accesses the native library (which automatically gives you better performance), and it was written with lots of help from the SQL Server team

Namespaces to connect database

Hey guys can you tell me what are the different namespaces used in the project to connect the database?

Yes sure , the namespaces use to connect database are
1. System.Data.OleDb – classes that make up the .NET Framework Data Provider for OLE DB-compatible data sources. These classes allow you to connect to an OLE DB data source, execute commands against the source, and read the results.
2. System.Data.SqlClient – classes that make up the .NET Framework Data Provider for SQL Server, which allows you to connect to SQL Server 7.0, execute commands, and read results. The System.Data.SqlClient namespace is similar to the System.Data.OleDb namespace, but is optimized for access to SQL Server 7.0 and later.
3. System.Data.Odbc – classes that make up the .NET Framework Data Provider for ODBC. These classes allow you to access ODBC data source in the managed space.
4. System.Data.OracleClient – classes that make up the .NET Framework Data Provider for Oracle. These classes allow you to access an Oracle data source in the managed space.

Interface or Abstract Class

When to go for for Interface or Abstract Class? whats the scenerio!!!!!!!!!!!!

Dear frien below are about the interface and abstract this will help you
Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes. Even though class inheritance allows your classes to inherit implementation from a base class, it also forces you to make most of your design decisions when the class is first published.
Abstract classes are useful when creating components because they allow you specify an invariant level of functionality in some methods, but leave the implementation of other methods until a specific implementation of that class is needed. They also version well, because if additional functionality is needed in derived classes, it can be added to the base class without breaking code.

Method Overriding

What is Method Overriding? How to override a function in C#?

Friend , use the override modifier to modify a method, a property, an indexer, or an event. An override method provides a new implementation of a member inherited from a base class. The method overridden by an override declaration is known as the overridden base method. The overridden base method must have the same signature as the override method.
You cannot override a non-virtual or static method. The overridden base method must be virtual, abstract, or override