Techno

MicroSoft ADO.NET | ActiveX Data Object

It is a set of software programs that allow access to databases by providing an interface that performs DB related operation on behave of our applications. A data provider can establish a connection to the DB, execute the command and retrieve results, insert, and update, delete the data. There is two type of provider that ADO. Net supports that are as follows:

1. OLEDB.net data provider: used for any DB systems.

2. SQL server.net data provider: used only for SQL server.

LEDB provider:

1. SQL OLEDB provider: for SQL server

2. Microsoft.jet.OLEDB.4.0: for MS Access

3. MSDAORA for oracle

Connection

It is used to establish a connection to the DB

Command

It is used to carry out the operations while connected to the DB.

Data adaptor:

The most flexible way to obtain a complete data from the data store is through the use of the OLEDB adaptor or SQL client.

Member of OLEDB data adaptor

Update, delete, insert, select and fill.

Dataset:

Dataset is an in-memory representation of any number of the table as well as any relationship between this table and any constraints.

Data table (DT)

The DT is a memory representation of a tabular block of data. It contains data in the tabular format and provides the facility to access the particular raw or columns.

Data reader:

This is the fastest way to obtain information from a data store using the data reader. It is useful where we need to iterate over a large amount of data very quickly and have no need to work and in-memory dataset representation.

Concept of ADO.net

ADO.net
ADO.net is a data object model that works with databases. Data access in ADO.net is based on disconnected architecture. This means that the connection need not be maintained that continuously while the application is executing the application connects to the DB as and where it needs to retrieve and update data. ADO.net provides a method to access data on local DBs, client-server and internet. It can work with any kind of DBs.

Advantages of ADO.net

Maintainability

If the application is implemented using ADO.net then tiers become a very easy process.

Programmability
It allows us to access data through typed programming this make code easier to read, write and debug.

Performance
It improves the performance of the form/ web pages because it works with the disconnected architecture.

Delegates

Delegates

A delegate is a type-safe object that can point to another method or possibly multiple methods is the application which can be invoked at the time. A delegate maintains three important pieces of information that are as follows:

1. The name of the method on which it makes the call.

2. Any argument of this method

3. The return value of this method

We can create delegates in C# with the use of keyword delegate. The name of the delegate can be whatever we desire.

Multicast delegates
Delegate’s ability to multicast means that delegates object can maintain a list of methods to call rather than a single method. If we want to add a method to the invocation list of a delegate object we simply make use of the overloaded += operator and if we want to remove a method from the invocation list we make use of the overloaded operator -=. The multicast delegate contains the method that returns void. If we want to create a multicast delegate with return type we will get the return type of the last method in the invocation list.

Note: - In multicast delegates, we normally use return type void. If we mention return type then it will return the last result of the function.
Advantages of delegates

There are the following advantages of using the delegates:

• Delegates are used to encapsulate a method.

• Delegates are just like C+ function which invoke to the actual method call.

• Delegate points to more than one method

• Delegates are function pointer that point to the instance and static numbers.

• A delegate hides the actual source code.

• A delegate is type-safe object-oriented and more sources.

• Delegates are managed function pointer they are type checked and held in space that can be reclaimed by the memory manager.

Events

Events are a member of the class that raises them. When something happens a class can raise an event which has a message that contains information about the event and sends them out to the rest of the application. Other parts of the application can respond to the even by executing methods called event handler.

The event handler is a method that has the same signature as the event and this method is executed when the event occurs. To define an event we first need to define a delegate that contains the method that will be called when the event revised and then we define the event based on that delegate.