I might be confused. I have never used IDataReader to read through the datareader.
I normally do something like the following to read through a SqlDataReader.
while (rdr.Read())
{
// get the results of each column
string contact = (string)rdr["ContactName"];
string company = (string)rdr["CompanyName"]; }My question is when do we do something like the following and what is the difference between the above and the below: Why to use IDataReader why not have ( SqlDataReader reader)?protected void ReadReader(IDataReader reader){ string contact = (string)rdr["ContactName"];
string company = (string ...
Go to the complete details ...