What is the easiest way to cast a SqlDataReader to IDatareader.
Or is it easier / possible to convert a List<> object to a IDataReader
What is the easiest way to convert a SqlDataReader to IDatareader
Since SqlDataReader
implements IDataReader
, this is just an implicit cast:
SqlDataReader typedReader = ...
IDataReader untypedReader = typedReader;