Вы находитесь на странице: 1из 5

10.

1 INTRODUCTION

Database is a collection of organized and structured information which provide


the facility the storage of data and retrieval of data. Data is stored in the database
in the form of record. Data is stored in the form of collection of records which in
turn makes the database. With the advancement of programming language
accesses of database have become more complex but fundaments of database
are still simple.
One of the popular ways to work with the database is SQL (Structure Query
Language). To store and retrieve the data with SQL, we use the commands or
collection of commands called query. The result that is return in response of
query to retrieve the data from database, is return in the form of set of records
called DataSet.

10.2 MICROSOFT DATA ACCESS TECHNOLOGIES


Microsoft has been introducing and enhancement ways to access the database
for Windows applications. It enhanced many existing technologies and
introduced many new technologies. Each of these technologies has its own
advantages and disadvantages. Some technologies works with the particular
data sources and some works with all kinds of data sources. Collectively these
technologies are called Microsoft Data Access Technologies or Microsoft Data
Access Components (MDAC). These are as follows:
1. Open Database Connectivity (ODBC): It is common database layer which
can access any relational database management system so it is difficult to
used ODBC to communicate with non-relational data sources such as
object based database. The ODBC Driver Manager provides the
connectivity to a database through an ODBC driver and ODBC
administration. The applications use the API (Application Programming
Interface) to communicate with the Driver Manager. It also provides the
ability to reuse the connection every time database is accessed rather to
create a new connection again.
Main purpose of ODBC is use the SQL using set of function call. For a
server which supports the SQL and ODBC, SQL statements are send to
target database and then SQL statements process the result. ODBC was
adopted by Open Source Community due its open standard nature. Many
database systems have been developed drivers for ODBC which cannot be
accessed by other data access technologies.
2. DAO (Data Access Objects): ODBC was designed to work the low level
language like C++ etc. DAO provide simple object model which work with
VB more naturally. It uses database engine called Jet which works
Microsoft’s Access desktop database. It is the fastest way to work with
Access database. It is very flexible so it can work with the different
database using the same code. It is designed to work with the one-tier
applications where program and database reside in the same platform.
DAO uses the local query processor which in turn require very high
amount of overhead for DAO application.
3. Remote Data Objects (RDO): It is a combination of ODBC and DAO which
gives the ease of programming. It is an object layer which was especially
designed to access the database which is client-server style. ODBC
compatible databases are accessed with high performance using RDO.
RDO Programmatic access is easy and overcome the problem of highly
overhead due to local query processor. It uses all the ODBC capabilities
but easier to use. RDO’s COM implementation integrate it with the IDE
and able to IntelliSense to prompting all of the RDO methods and
properties. Although it was good solution of ODBC and DAO but it was
replaced by ADO technology which can access the heterogeneous data
source by simple programming model.
4. OLE-DB: OLE-DB is based on the Microsoft strategy for Universal Data
Access (UDA). The idea behind UDA is that apart from data is stored in the
Traditional databases it is also store in the Web pages, Spreadsheets, e-
mails etc. This data should be accessed using single technology. So OLE-
DB drivers cover both relational and non-relational databases. It shows
that virtually all types of data sources can be accessed.
OLE-DB access the data in a standard row/column format by using set of
COM interfaces. An application is called the OLE-DB Consumer which
makes use of data provided by OLE-DB interface. OLE-DB is useful for the
applications which support the Middle Tier architecture. This architecture
provide service that are used with the data provider. Example of these
services are connection pooling, data persistence, client side data
manipulation, transaction enlistment, data remoting and hierarchical
recordsets.
The use of OLE-DB is not suitable for the language which didn’t support
low-level functions such as VB, ASP, JAVA, JavaScript and others.
5. ActiveX Data Objects (ADO): ADO is thin layer between the high level
language and OLE-DB which make these languages like VB and
JavaScript etc. to access OLE-DB data sources through a simple object
model. It works as middleware between languages which doesn’t support
direct memory allocation and pointers. ADO based applications access
system resources such as Active Directory and data resources such SQL.
It provides the ability server-side cursor, executing store procedures,
return result sets, execute parameterized queries and support
transactions. It provides better solutions for two-tier based database
application but also supports N-tired oriented features like disconnected
design and connection pooling. It is not suitable N-tired web based
applications because in two-tier application it requires maintaining of
persistence database. This requirement massive increases the number of
connections and holding those connections open tended to result makes
it non-scalable. Deployment of application is also difficult because ADO is
COM based and components require registration in Window registry before
the use of application.
6. ADO.NET: ADO.NET provides a data access interface to communicate
OLE-DB compatible data source like Oracle and SQL server. It is based on
XML, an industry standard which helps to create distributed and data
sharing applications. A Major problem in traditional client/server based
applications that it has to maintain the database connection until the
application is running. It consumes the plenty of server resources and not
useful when you work with web applications for which we use the
disconnected DataSets. ADO.NET support disconnected data architecture,
an architecture where we work with the copy of database rather than its
actual data.
ADO.NET is important part of .NET framework which has different set of
classes to expose data access services which helps to provide the
consistent access to data sources like XML (Extensible Markup Language),
Oracle, Microsoft SQL Server and OLEDB. ADO .NET can be used to
connect with the data base using Data Providers, retrieve, manipulate and
update data by executing of commands and retrieving results. These
results can be processed using ADO.NET DataSet objects where data is
stored in temporary form or directly by the applicaton. Distributed
applications are created using rich set of components which uses the XML
DataSets in ADO.NET.

10.3 ADO.NET FEATURES


There are some more features incorporated in ADO.NET.
1. Bulk Copy Operation: It is a new feature which can copy the large amount
of data from one data source to another. ADO.NET has classes which
provide the fastest transfer of large amount of data and each data provider
supports this feature. For example SqlBulkCopy is a class of SQL data
provider which can read a DataSet, DataTable or XML objects.
2. Batch Update : This feature works when database server supports it.
Normally in a server we require many turns to update the data in batch
form. It is an totally improved features to give the performance which
update the multiple batch in the server in just one round trip. For example
a specific number of rows can be updated using the UdateBatchSize
property.
3. Data Paging: There is new execute method which can extract the rows
within the given range. This method is called ExecutePageReader which
takes three parameters: CommandBehaviour, StartIndex and PageSize.
For example to extract the rows between 500 and 600 just pass the start
index as 500 and page size as 80.
4. Connection Details: Now a connection detail can got in more depth by
using the StatiticsEnabled property of connection which has to be set true.
Connection information is stored in the HasTable object like cursor detail,
buffer information, user detail and transactions. The HasTable object is
returned by RetrieveStatitics method of Connection Object.
5. DataSet.RemotingFormat Property: DataSet are serialized using the
XML tagged format. But binary format can also be used to serialization
and deserialization of data by setting the DataSet.RemotingFormat
property value to binary. It enhance the performance serialization process.
6. DataTable's Load and Save Methods: There are two methods, Load and
Save, in ADO.NET which worked with only DataSet. Load method get the
data from the objects and Save method store the data in non volatile
media.
Now these methods can also work with DataTable which can load the
DataReader object into DataTable using Load method.
7. New Data Controls: In Toolbox, you will see these new controls -
DataGridView, DataConnector, and DataNavigator. See Figure 1. Now
using these controls, you can provide navigation (paging) support to the
data in data bound controls.

Figure 10.1 Data bound controls.

8. DbProvidersFactories Class: It is most helpful class to work on different


types architectures. When database independent applications are written
then using this class one can get the list of available data providers on a
machine. It also helps by finding the best suited data provider for the given
machine and database along with its class and members.
9. Customized Data Provider: A factory classes can be used as the base
class to extend the support in order to create the customized Data
Provider. You have to write connection code using connection string which
make it work with.

10.4 DIFFERENCE BETWEEN ADO AND ADO.NET

ADO ADO.NET
Base of ADO is Component Object Base of ADO.Net is Common Language
Modelling (COM) Runtime (CLR)
Data in ADO is stored in binary format. Data in ADO>NET is stored in XML
format.
ADO has limited access to XML so ADO XML has full support to ADO.NET. It uses
can not be integrated with XML. the XML schema to store data.
RecordSet is used in ADO to provide DataSet ro DataAdapter is used in
data. ADO.NET to provide data.
ADO requires continuous active ADO.NET does not require continuous
connection so it is connection oriented. connection it works with disconnected
mode.
ADO scans the rows sequentially by ADO.NET represents data as a collection
giving the rows as single table view. of rows which can be accessed via loop.
ADO supports only Client side cursor. ADO.NET supports Server and Client
cursor side cursor both.
ADO requires multiple connections to ADO.NET requires single connection to
handle the multiple transactions. handle multiple transactions.

Вам также может понравиться