Link to home
Start Free TrialLog in
Avatar of mathieu_cupryk
mathieu_cuprykFlag for Canada

asked on

What does an executereader return?

What does an executereader return?
Avatar of ozymandias
ozymandias
Flag of United Kingdom of Great Britain and Northern Ireland image

A DataReader
Avatar of mathieu_cupryk

ASKER

...a single value.
 
 
--------------------------------------------------------------------------------
 
  ...an XML DataSet.
 
 
--------------------------------------------------------------------------------
 
  ...a rowset.
 
 
--------------------------------------------------------------------------------
 
  ...nothing as there is no value to return.
 
which of the four?
ASKER CERTIFIED SOLUTION
Avatar of Sinclair
Sinclair

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It returns a class derived from DataReader depending on the type of the Command, i.e. an OdbcCommand.ExecuteReader() returns an OdbcDataReader.
The best answer is probably a rowset.
Avatar of Sinclair
Sinclair

It's kind of a pointless question, though, even for an "Intro to C#" course. All you need to do is memorize the right keywords, and you pass... but... that doesn't actually teach you anything. If they asked, "how many rows is the DataReader guaranteed to contain", or "which row is the DataReader's internal pointer pointing to immediately after the method returns", that would at least be something. But even then, who cares ? All that info is in the API comments, it doesn't take too long to look it up.

Sorry, I know that was offtopic, I just find CS classes like this one really frustrating :-(