0% found this document useful (0 votes)
16 views

Points To Be Discussed: Execution Command Insertion Command Updation Command Deletion Command Select Command

This document discusses ADO.NET and its components for accessing and manipulating data from databases. ADO.NET provides consistent access to data sources through two main objects: the DataSet, which acts as a container for data retrieved from databases, and .NET data providers like SqlClient and OleDb which provide connections, commands, and data readers/adapters to interact with different database types. The core ADO.NET classes that allow applications to perform common data operations are the Connection, Command, DataReader, and DataAdapter objects.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Points To Be Discussed: Execution Command Insertion Command Updation Command Deletion Command Select Command

This document discusses ADO.NET and its components for accessing and manipulating data from databases. ADO.NET provides consistent access to data sources through two main objects: the DataSet, which acts as a container for data retrieved from databases, and .NET data providers like SqlClient and OleDb which provide connections, commands, and data readers/adapters to interact with different database types. The core ADO.NET classes that allow applications to perform common data operations are the Connection, Command, DataReader, and DataAdapter objects.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Points to be Discussed

ADO.NET

Accessing Database with ADO.NET Execution Command Insertion Command Updation Command Deletion Command Select Command

Accessing database with ADO.NET

ADO.NET

ost applications need data access at one point o! time. Data Access is ma"ing the application interact with a database# where all the data is stored. Di!!erent applications ha$e di!!erent re%uirements !or database access. C& uses ADO.NET(ActiveX Data Object) as its data access. ADO.NET is a set o! computer so!tware components that programmers can use to access data and data ser$ices. It is commonl' used b' programmers to access and modi!' data stored in relational database s'stems. such as icroso!t S() Ser$er# as well as data sources exposed through O)E D* and + ).

ADO.NET pro$ides consistent access to data sources

ADO.NET
ADO.NET pro$ides two ob,ects to manipulate data

pulled out o! a data source.


-. DataSet .. .NET Data pro$ider

-.

Data Set: ADO.NET uses the disconnected approach using the DataSet. The DataSet acts as a container. All the data coming !rom the database is dumped in the DataSet# to use and manipulate. The database is then later updated with the DataSet. DataSet consists o! DataTables. DataTables are similar to tables or relations in D* S. DataTables contain Data/ows and DataColumns.

ADO.NET
.. .NET Data Provider: pro$iders a$ailable0 There are two .NET data
-. The S() Ser$er .NET Data 1ro$ider .. The O)ED* .NET Data 1ro$ider

S() Ser$er .NET Data 1ro$ider classes are located in the System.Data.Sq ! ient namespace. O)ED* .NET Data 1ro$ider classes are located in System.Data.O"ED# namespace. These .NET pro$iders include the !onnection ob,ect# the !ommand ob,ect# the Data$eader and the DataAda%ter in their corresponding namespaces.

Names%aces &or ADO.NET


The !onnection ob,ect pro$ides connecti$it'

to a data source. The !ommand ob,ect enables access to database commands to return data# modi!' data# run stored procedures# and send or retrie$e parameter in!ormation. The Data$eader pro$ides a stream o! read2onl' and !orward2onl' data !rom the data source. DataAda%ter pro$ides the bridge between the DataSet ob,ect and the data source.

ADO.NET Data Arc'itecture

Data Access (it' ADO.NET


A

connection ob,ect establishes the connection !or the application with the database. The command ob,ect pro$ides direct execution o! the command to the database. I! the command returns more than a single $alue# the command ob,ect returns a Data/eader to pro$ide the data. Alternati$el'# the DataAdapter can be used to !ill the Dataset ob,ect. The database can be updated using the command ob,ect or the DataAdapter.

!om%onent ! asses o& Data Providers


T'e !onnection Object: The Connection ob,ect creates the connection to the

database. .NET pro$ides two t'pes o! Connection classes0 the S%lConnection ob,ect# and the OleDbConnection ob,ect. The Connection ob,ect contains all o! the in!ormation re%uired to open a connection to the database.
T'e

!ommand Object: The Command ob,ect is represented b' two corresponding classes0 S%lCommand and OleDbCommand. Command ob,ects are used to execute commands to a database across a data connection. Command ob,ects pro$ide three methods that are used to execute commands on the database0 E*ecuteNon+uery: Executes commands that ha$e no return $alues such as INSE/T# U1DATE or DE)ETE E*ecuteSca ar: /eturns a single $alue !rom a database %uer' E*ecute$eader: /eturns a result set b' wa' o! a Data/eader ob,ect

). ,. -.

!om%onent ! asses o& Data Providers


T'e Data$eader Object: The Data/eader ob,ect pro$ides a !orward2

onl'# read2onl'# connected stream recordset !rom a database. The S%lCommand.Execute/eader method returns a S%lData/eader ob,ect# and the OleDbCommand.Execute/eader method returns an OleDbData/eader ob,ect.
T'e DataAda%ter Object: The DataAdapter class is used either to !ill a

DataTable or DataSet with data !rom the database with it3s 4ill method. A!ter the memor'2resident data has been manipulated# the DataAdapter can commit the changes to the database b' calling the Update method. The DataAdapter pro$ides !our properties that represent database commands0
-. SelectCommand .. InsertCommand 5. DeleteCommand 6. UpdateCommand

You might also like