I've a dataset with a table and I want to copy these values to sqldatareader. Is there any way to do this in C#?
I tried with ds.CreateDataReader(); but it is returning DataTableReader and not SQLDataReader.
Can someone tell me how to get it done?
You can't copy data to a data reader, because the data reader doesn't contain any data in itself, it reads from a data source.
Each data reader reads from a specific data source, so for an SqlDataReader the data source would be an SQL Server database, not a DataSet object.
So, what you are specifically asking for is not possible. If you can use the DbDataReader base class instead of specifically the SqDataReader class, then you can use any data reader.
SQLDataReader? Can you use theDbDataReaderclass that both inherit from?