---
title: "What are the different methods available under sqlcommand class to access the data?"  
description: "What are the different methods available under sqlcommand class to access the data?"  
author: "Sumit Kesarwani"  
published: 2014-01-27  
updated: 2020-09-15  
canonical: https://www.mindstick.com/interview/1895/what-are-the-different-methods-available-under-sqlcommand-class-to-access-the-data  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# What are the different methods available under sqlcommand class to access the data?

**ExecuteReader -** Used where one or more records are returned - SELECT Query.

**ExecuteNonQuery -** Used where it affects a state of the table and no data is being queried - INSERT, UPDATE, DELETE, CREATE and SET queries.

**ExecuteScalar -** Used where it returns a single record.

## Answers

### Answer by Sumit Kesarwani

**ExecuteReader -** Used where one or more records are returned - SELECT Query.

**ExecuteNonQuery -** Used where it affects a state of the table and no data is being queried - INSERT, UPDATE, DELETE, CREATE and SET queries.

**ExecuteScalar -** Used where it returns a single record.


---

Original Source: https://www.mindstick.com/interview/1895/what-are-the-different-methods-available-under-sqlcommand-class-to-access-the-data

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
