DEV Community

Steve Mak
Steve Mak

Posted on

1

Learning Notes of ADO.NET

Primary Objects

(Ref: https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/data-providers)

  1. Connection - Provides connectivity to a data source.
  2. Command - Enables access to database commands to return data, modify data, run stored procedures, and send or retrieve parameter information.
  3. DataReader - Provides a high-performance stream of data from the data source.
  4. DataAdapter - Provides the bridge between the DataSet object and the data source. The DataAdapter uses Command objects to execute SQL commands at the data source to both load the DataSet with data and reconcile changes that were made to the data in the DataSet back to the data source.
  5. DataSet - Contains a collection of one or more DataTable objects consisting of rows and columns of data, and also primary key, foreign key, constraint, and relation information about the data in the DataTable objects. (DataTable, DataView, DataRow)

DataReader or DataSet

Use a DataSet to do the following:

  • Cache data locally in your application so that you can manipulate it. If you only need to read the results of a query, the DataReader is the better choice.
  • Remote data between tiers or from an XML Web service.
  • Interact with data dynamically such as binding to a Windows Forms control or combining and relating data from multiple sources.
  • Perform extensive processing on data without requiring an open connection to the data source, which frees the connection to be used by other clients.

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay