Download - ADO.NET Introduction
![Page 1: ADO.NET Introduction](https://reader035.vdocument.in/reader035/viewer/2022072000/55d62205bb61ebd61e8b46c5/html5/thumbnails/1.jpg)
ADO.NETYogendra Tamang
![Page 2: ADO.NET Introduction](https://reader035.vdocument.in/reader035/viewer/2022072000/55d62205bb61ebd61e8b46c5/html5/thumbnails/2.jpg)
Introduction
• Data Access and Manipulation Protocol• Disconnected Data Architecture i.e data you work with is just a copy
of data in the actual database.• Objects are found on System.Data.dll
![Page 3: ADO.NET Introduction](https://reader035.vdocument.in/reader035/viewer/2022072000/55d62205bb61ebd61e8b46c5/html5/thumbnails/3.jpg)
Features
• LINQ• LINQ to DAtaSet• LINQ to SQL
![Page 4: ADO.NET Introduction](https://reader035.vdocument.in/reader035/viewer/2022072000/55d62205bb61ebd61e8b46c5/html5/thumbnails/4.jpg)
ADO.NET Objects
• The connection objects [SqlConnection Object]• Connection to datasource to read and write data with these objects
• DataAdapter Objects • Provides communication between datasource and dataset
• Command Object• Allows data adapters to read, add, update and delete records in datasource
• DataTable Object• Holds a data table from a datasource [Columns and Rows]
![Page 5: ADO.NET Introduction](https://reader035.vdocument.in/reader035/viewer/2022072000/55d62205bb61ebd61e8b46c5/html5/thumbnails/5.jpg)
ADO.NET Objects
• Data Reader Objects• Holds read-only, forward only set of data from database.• Fast because only one row of data in a memory at a time.
• Data View Objects • Customized view of single object
• Constraint Object• Allows data adapters to read, add, update and delete records in datasource
• DataTable Object• Holds a data table from a datasource [Columns and Rows]
![Page 6: ADO.NET Introduction](https://reader035.vdocument.in/reader035/viewer/2022072000/55d62205bb61ebd61e8b46c5/html5/thumbnails/6.jpg)
Data Providers in ADO.NET
• Set of related components that work together to provide data in efficient manner.• Connecting to DB, executing commands and retrieving results
OBJECTS• Connection• Command• DataReader• DataAdapter
![Page 7: ADO.NET Introduction](https://reader035.vdocument.in/reader035/viewer/2022072000/55d62205bb61ebd61e8b46c5/html5/thumbnails/7.jpg)
DataSet
• In-memory representation of Data• Local copy of relevant portions of Database• Data in DataSet can be manipulated and updated
independent of the database.• Components of DataSet• DataTable• Stores data in table row format[DataRow and DataColumn]• NewRow() method for adding row to DataTable.
![Page 8: ADO.NET Introduction](https://reader035.vdocument.in/reader035/viewer/2022072000/55d62205bb61ebd61e8b46c5/html5/thumbnails/8.jpg)
• Components of DataSet• DataView
![Page 9: ADO.NET Introduction](https://reader035.vdocument.in/reader035/viewer/2022072000/55d62205bb61ebd61e8b46c5/html5/thumbnails/9.jpg)
DataReader
• Sequentially read the data from datasource.• Single row of data is loaded to memory at a time.• Commnad Object is used to retrieve data from database using
DataReader.• After Creating Command Object use command.ExecuteReader to
retrieve row of data from the database.• Use Read() method to read row from results of query.• Call Close() method when you finish using DataReader Object.
![Page 10: ADO.NET Introduction](https://reader035.vdocument.in/reader035/viewer/2022072000/55d62205bb61ebd61e8b46c5/html5/thumbnails/10.jpg)
DataSet Or DataReader ????
![Page 11: ADO.NET Introduction](https://reader035.vdocument.in/reader035/viewer/2022072000/55d62205bb61ebd61e8b46c5/html5/thumbnails/11.jpg)
DataAdapter