Page 90 - DCAP312_WEB_TECHNOLOGIES_II
P. 90
Web Technologies-II
Notes • Understand the ADO .NET DataSet
• Define ADO .NET DataReader
• Understand the connection pooling
Introduction
The concept behind concerning to a database has forever been confusing for learner application
developers. This post focuses on the dissimilar methods accessible for connecting to databases
in C#.
The software support provided by a database seller to access its own creation is identified as a
‘Native driver’. This provides the simplest process of connectivity as the data access takes place
without any interference by other software layers. But, as the database changes, the data access
mechanism also needs to be changed accordingly in this move toward.
So as to standardize data access, Microsoft released a set of general access drivers called OleDb,
which stands for Object Linking and Embedding DataBase. It is said to support compound skill,
which means that it can either connect to a database using resident drivers or seek the help of
other Data Access drivers like ODBC (Open DataBase Connectivity) to access the data store.
Later on, a set of APIs were made to communicate effectively with data in the data store.
The common APIs available were
• DAO – Data Access Object
• RDO – Remote Data Object
• ADO – ActiveX Data Object
• ADO.NET – ActiveX Data Object for .NET
The two distinct type of data access models defined are:
• Connected Approach ( Connection Oriented)
• ii) Disconnected Approach
• In Connected approach, whenever a query is run, the results are stored in an ActiveX
DataSet in the server. A pointer to this ActiveX dataset is returned to the client. This pointer
is known as Cursor. Therefore, to access the results, a connection must be consistently
open between the server and the client.
In the Disconnected approach, the results of a query and sent back to the client, and stored in a
client side cursor. This in turn means that continuous connectivity need not exist between the
server and the client.
In .NET, connected approach is accomplished using the following objects.
• Connection
• Command
• DataReader
The Connection is used to send an authority across to the server, which is executed and the
consequence is stored in the server side cursor, which in turn is read using the DataReader.
Disconnected approach makes use of the following objects:
• Connection
84 LOVELY PROFESSIONAL UNIVERSITY