Querying a Database with ADO.NET

Querying a Database with ADO.NET: Querying a Database with ADO.NET: an overview, ADO.NET Objects, Full Example.

Updated

  1. Querying a Database with ADO.NET: an overview (Journeyman): Every database query from C# takes three steps, connect, run the SQL, read the results, and each step has its own ADO.NET object.
  2. ADO.NET Objects (Journeyman): Use SqlConnection to connect, SqlCommand to run SQL, and SqlDataReader to read rows, choosing ExecuteReader, ExecuteScalar or ExecuteNonQuery for each kind of statement.
  3. Full Example (Journeyman): A complete console program that reads the connection string from appsettings.json, queries Northwind's categories, and prints a report.