Microsoft Windows Forms quickstarts tutorial-building applications

Source: Internet
Author: User
Ado. Net Overview

Connections

Connections are used to 'talk to 'databases, and are respresented by provider-specific classes suchSqlconnection. Commands travel over connections and resultsets are returned in the form of streams which can be read byDatareaderObject, or pushed intoDatasetObject.

Commands

Commands contain the information that is submitted to a database, and are represented by provider-specific classes suchSqlcommand. A command can be a stored procedure call, an update statement, or a statement that returns results. you can also use input and output parameters, and return values as part of your command syntax. the example below shows how to issue an insert statement againstNorthwindDatabase.

Datareaders

TheDatareaderObject is somewhat synonymous with a read-only/forward-only cursor over data.DatareaderAPI supports flat as well as hierarchical data.DatareaderObject is returned after executing a command against a database. The format of the returnedDatareaderObject is different from a recordset

Datasets and dataadapters

Datasets
TheDatasetObject is similar to the ADORecordsetObject, but more powerful, and with one other important distinction:DatasetIs always disconnected.DatasetObject represents a cache of data, with database-like structures such as tables, columns, relationships, and constraints. However, thoughDatasetCan and does behave much like a database, it is important to remember thatDatasetObjects do not interact directly with databases, or other source data. this allows the developer to work with a programming model that is always consistent, regardless of where the source data resides. data coming from a database, an XML file, from code, or user input can all be placedDatasetObjects. Then, as changes are made toDatasetThey can be tracked and verified before updating the source data.

Dataadapters (oledb/SQL)
TheDataadapterObject works as a bridge betweenDatasetAnd the source data.
TheDataadapterObject uses commands to update the data source after changes have been made toDataset. UsingFillMethod ofDataadapterCallthe SELECT command; usingUpdateMethod callthe insert, update or delete command for each changed row.

Section Summary
  1. ADO. NET is the next evolution of ADO for the. NET Framework.
  2. Ado. Net was created with N-tier, statelessness and XML in the forefront. Two new objects,DatasetAndDataadapter, Are provided for these scenarios.
  3. Ado. Net can be used to get data from a stream, or to store data in a cache for updates.
  4. There is a lot more information about ADO. net in the documentation.
  5. Remember, you can execute a command directly against the database in order to do inserts, updates, and deletes. You don't need to first put data intoDatasetIn order to insert, update, or delete it.
  6. Also, you can useDatasetTo bind to the data, move through the data, and navigate data relationships.

Bytes -------------------------------------------------------------------------------------------

XML Web Services created using ASP. NET Overview

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.