In ADO.NET, what is the role of the SqlDataReader when retrieving data using SELECT statements?

  • SqlDataReader is used to execute SQL commands and retrieve data from the database.
  • SqlDataReader is used to insert new records into the database.
  • SqlDataReader is used to update or delete records in the database.
  • SqlDataReader provides a forward-only, read-only stream of data from the database when executing a SELECT statement.
The SqlDataReader class in ADO.NET is specifically designed for reading a forward-only stream of data from a SQL Server database. It provides a fast and efficient way to retrieve data from SELECT statements by allowing sequential access to the rows in the result set. Unlike other data access classes in ADO.NET, SqlDataReader is optimized for performance and is ideal for scenarios where you need to read large volumes of data quickly and efficiently.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *