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.

DevCycle image

Ship Faster, Stay Flexible.

DevCycle is the first feature flag platform with OpenFeature built-in to every open source SDK, designed to help developers ship faster while avoiding vendor-lock in.

Start shipping

Top comments (0)

Dev Diairies image

User Feedback & The Pivot That Saved The Project

🔥 Check out Episode 3 of Dev Diairies, following a successful Hackathon project turned startup.

Watch full video 🎥

👋 Kindness is contagious

Sign in to DEV to enjoy its full potential—unlock a customized interface with dark mode, personal reading preferences, and more.

Okay