Course Hero Logo

ADO.NET.pdf - Different applications have different...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 11 out of 40 pages.

Different applications have different requirements fordatabase access. .Net Framework uses ADO.Net (ActiveX Data Objects) as it’s data access and manipulationprotocol which also enables us to work with data onthe internet.When an application interacts with the database, theconnection is opened to serve the request of theapplication and is closed as soon as the request iscompleted. Likewise, if a database is updated, theconnectionis opened long enough to complete theupdate operation and is closed.
By keeping connections open for only a minimumperiod of ADO.Net conserves system resources andprovides maximum security for databases and also hasless impact on system performance.Also, ADO.Net when interacting with the database usesXML and converts all the data into XML format fordatabase related operations making them moreefficient.
InteroperabilityCan use XML to read and write and move data.Scalability through the disconnected dataset.Connections are not maintained for long periodsDatabase locking does not occurMaintainabilitySeparation of data logic and user interfaceProgrammabilityADO.NET data components in Visual Studio encapsulate dataaccess functionality in various ways that help you programmore quickly and with fewer mistakes.
Data ProviderA data provider is used for connecting to a database,executing commands and retrieving data, storing it in adataset, reading the retrieved data and updating thedatabase.ADO.Net comes with data providers includingOleDbSqlClientBoth OleDb and SqlClienthas it’s own set of classes.But they have the same concepts.
The Data Provider in ADO.Net consists of the four objects:ConnectionThis component is used to set up a connection with a datasource. Contains all of the information required to open aconnection to the database.CommandA command is a SQL statement or a stored procedure used toretrieve, insert, delete or modify data in a data source.ExecuteNonQuery: Executes commands that have noreturn values such as Insert, Update or Delete.ExecuteScalar: Returns a single value from a databasequery .ExecuteReader: Returns a results set by way of aDataReader object.
DataReaderData reader is used to retrieve data from a datasource in a read-only and forward-only mode.The DataReader is returned as the result of thecommand object’s Executive Reader Method.DataAdapterMiddle man facilitating at communication betweenthe database and a dataset.The DataAdapter is used either to fill a DataTable orDataSetwith data from the database with it’s FillMethod.
Data SetDataSet is an in-memory representation of data. It is adisconnected, cached set of records that are retrievedfrom a database.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 40 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
NoProfessor
Tags

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture