J
Jim Heavey
I have written the following method..
public IDataReader CreateDataReader(IDbCommand cmd)
{
if (ProviderType == 0)
{
OleCommand oCmd = (OleCommand) cmd;
OleDbDataReader dr = oCmd.ExecuteReader;
return (IDataReader) dr;
}
}
Would it be valid to write it like this?
public IDataReader CreateDataReader(IDbCommand cmd)
{
if (ProviderType == 0)
{
IDbDataReader dr = cmd.ExecuteReader;
return dr;
}
}
The IDbCommand being passed is ultimated either a OleDBCommand or a
SqlCommand - so is it valid to use the IDbCommand prior to changing it to
the appropriate class?
If that is valid, Since the type of object which is returned by the
cmd.ExecuteReader is either an OleDbDataReader or a SqlDataReader, must I
first get that and then "reclass" it to the IDataReader.
Thanks IN Advance for your assistance!!!!!!!!!!
public IDataReader CreateDataReader(IDbCommand cmd)
{
if (ProviderType == 0)
{
OleCommand oCmd = (OleCommand) cmd;
OleDbDataReader dr = oCmd.ExecuteReader;
return (IDataReader) dr;
}
}
Would it be valid to write it like this?
public IDataReader CreateDataReader(IDbCommand cmd)
{
if (ProviderType == 0)
{
IDbDataReader dr = cmd.ExecuteReader;
return dr;
}
}
The IDbCommand being passed is ultimated either a OleDBCommand or a
SqlCommand - so is it valid to use the IDbCommand prior to changing it to
the appropriate class?
If that is valid, Since the type of object which is returned by the
cmd.ExecuteReader is either an OleDbDataReader or a SqlDataReader, must I
first get that and then "reclass" it to the IDataReader.
Thanks IN Advance for your assistance!!!!!!!!!!