Pages

Sunday, 4 September 2016

Chapter-2 ADO.NET

Difference between ADO and ADO.NET

1) In Memory representation of Data:- ADO use a record set to represent data that
is retrieved from table in memory whereas ADO.NETuse datasets. ADO use data
from a single table to retrieve the data from multiple table we have to use
Join . But in ADO.NET , we use dataset can store data from multiple table .
Dataset represent the structure of a database .

ADO provides read
only data on recordsets which allows you to navigate sequentially through the
rows of recordset. In ADO.NET rows are represented as collections.

2) Minimized Open Connections:- ADO.NET ,you only connect to database to
retrieve and update data records. In ADO.NET it retrieve the data from database
and store in dataset and this disconnect from database it works in
disconnected. In ADO it works in connected .

3) Sharing Data between Applications:- You can use COM marshaling in ADO to transfer
the data from disconnected record sets to another components . In ADO.NET it
use dataset using an XML .

Advantage of XML
over COM marshaling:

i)Richer data type : COM marshaling can convert only one datatype whereas XML can transfer of
any datatype

ii)ByPassing Firewalls :A
firewall does not allow system level in case of COM Marshaling therefore
recordset cannot bypass a firewall. However using XML in ADO.NET you can send
data though firewall.

b)Connection pooling enables a data source to
reuse connections for a particular user.

c)A connected environment is one in which a user
or an application is constantly connected to a data source.

d)A disconnected environment is one in which a
user or an application is not directly connected to a data source.

e)The two types of operations performed by a
command object to retrieve and modify data in a data source are:

i)Synchronous operations

ii)Asynchronous operations

f)During synchronous operations, the command
objects are linked to each other.

g)Synchronous operations are performed with the
help of the following command objects:

i)DbCommand object

ii)DbParameters object

iii)DbDataReader object

I hope that the functionality of the above attribute is clear to you now.
Now you can use this code in your application. If you have further question,
just drop a line below and I will try to answer you as soon as possible.

Last but not least, connect with me onTwitter , Facebook , LinkedInandGoogle+for technical updates and articles news. We won’t spam or share your email
address as we respect your privacy.