Mid From PDF ADO.NET ADO.NET

Using ExecuteReader (for a single row, multiple columns):?

Short answer: SqlCommand command = new SqlCommand("SELECT CustomerName, ContactName FROM Customers WHERE CustomerID = @CustomerID", connection); command.Parameters.AddWithValue("@CustomerID", 1); connection.Open(); SqlDataReader reader = command.ExecuteReader();

Example code

if (reader.Read()) // Checks if there's data
{
string customerName = reader["CustomerName"].ToString();
string contactName = reader["ContactName"].ToString(); Console.WriteLine($"Customer: {customerName}, Contact: {contactName}"); } reader.Close(); connection.Close();

Real-world example (ShopNest)

ShopNest’s reporting job still uses ADO.NET for a heavy SQL query where raw performance and stored procedures matter more than EF convenience.

Say this in the interview

  1. Define — one clear sentence (the short answer above).
  2. Example — relate it to a project like ShopNest or your real work.
  3. Trade-off — when you would not use it.
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details