0% found this document useful (0 votes)
27 views16 pages

Database Connectivity: Com Based Model Name Space Model

Database connectivity in .NET can use ADO or ADO.NET. ADO.NET uses a name space model and supports both a connection-oriented model and disconnected model. The connection-oriented model requires a constant connection to the database, while the disconnected model maintains data in a dataset on the client without a live connection. Key components of ADO.NET include connections, commands, data adapters, datasets, and data readers.

Uploaded by

Fenil Desai
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views16 pages

Database Connectivity: Com Based Model Name Space Model

Database connectivity in .NET can use ADO or ADO.NET. ADO.NET uses a name space model and supports both a connection-oriented model and disconnected model. The connection-oriented model requires a constant connection to the database, while the disconnected model maintains data in a dataset on the client without a live connection. Key components of ADO.NET include connections, commands, data adapters, datasets, and data readers.

Uploaded by

Fenil Desai
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 16

DATABASE CONNECTIVITY

IN .NET
 ADO
– COM BASED MODEL
 ADO.NET
– NAME SPACE MODEL
ADO.NET
 CONNECTION ORIENTED MODEL
 DISCONNECTED ORIENTED MODEL
CONNECTION ORIENTED
MODEL
 Whenever an application uses the
connection oriented model to interact with
the db then the connectivity between the
application and the database has to be
maintained always.
Connection Oriented

Application db
DATA PROVIDERS

Data Reader Command Connection

 Whenever an user executes any statement


other than a select then command object can
be binded directly to the application
 If the user executes a select statement then
dataReader is used to bind the result to the
application.
Disconnected Oriented Model in
ADO.net
 When the user interacting with the db using
this model then while performing the
manipulations or navigations on the data
connectivity between the application and the
database is not required
Note: When ever the data is been updated on to
the database then the connectivity is required
in the disconnected model.
DISCONNECTED MODEL

Application Data View DataSet Database

This is available in
client system
Data Adapter Connection

Data Providers
Disconnected Model
 Connection  it is used to establish the physical
connection between the application and the database
 DataAdapter it is a collection of commands which acts
like a bridge between the datastore and the dataset.
 Commands in DataAdapter 

DataAdapter Collection of all these commands


is DataAdapter
Select Command
Fill(Dataset Name[,DataMember])
Table Mappings

Insert Command

Update Command
Update(Dataset Name[,DataMember])
Delete Command
Points to remember about
DataAdapter
 DataAdapter can always be binded to a single
table at a time.
 Whenever the dataAdapter is used then
implicit opening and closing of connection of
closing object will take place.
 If the dataAdapter is defined using a tool or a
control then all the commands for the adapter
will be defined implicitly provided the base
table with a primary key.
 If the base table is not defined with a primary
key then the commands relevant for update
command and Delete command will not be
defined.
Fill Method
 It is used to fill the data retrieved by the select
command of DataAdapter to the dataset.

Data Adapter
db
Select Command

Select * from emp

Fill(ds,”emp”)

DS
Update Method
 It is used to update the dataAdapter with the
data present in the dataMember of the dataSet.
 In other words used to the update the
database.

Data Adapter
db
Update(ds,”emp”)

DS
DataSet
 It is an in memory representation of the data in
the format of XML at the client system.
 Points to remember about DataSet:
– It contains any no of datatables which may belong to
the same or different databases also.
– If any manipulation are performed on the database it
will not be reflected on to the database.
– Dataset is also considered as a collection of datatables
where a datatable can be considered as a
DataMember.
– Dataset will not be aware of from where the data is
coming from and where the data will be passed from
it.
– Dataset supports establishing the relationship between
the datatables present in the dataset where the
datatables might belong to different databases also.
Data Set
 DataSet is of 2 types 
– Typed DataSet  when ever the dataset is
defined with the support of XML schema
definitions then it is said to be typed dataSet.
– UnTyped DataSet  if the dataset is defined
without the XML Schema Definition then it is
said to be UnTyped DataSet.
DataView
 It is logical representation of the data
present in the datamember of dataSet.
 Usage  It is used to sort the data,filter
the data or if the data has to be projected in
the pagewise then the dataView should be
used.
Command
 It is used to provide the source for
executing the statement I.e it used to
specify the command to be executed.
Data Reader
 It is a forward and read only record set
which maintains the data retrieved by the
select statement.
ADO.NET

DISCONNECTED MODEL CONNECTION ORIENTED MODEL

Used if the statement is CONNECTION


CONNECTION select statement

DATA ADAPTER COMMAND

DATA SET DATA READER

DATA VIEW UI

UI
Used if the data has to be filtered,
sorted or if the data has to be projected
in page-wise

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy