juniorADO.NET
What is SqlCommand?
Updated Apr 28, 2026
Short answer
SqlCommand is used to execute SQL queries or stored procedures.
Deep explanation
It executes SQL statements against the database. Supports commands like SELECT, INSERT, UPDATE, DELETE.
Real-world example
Executing queries to fetch user records.
Common mistakes
- Not parameterizing queries.
Follow-up questions
- What is ExecuteReader?
- What is ExecuteNonQuery?