I am wondering what you consider as the best way to map SqlDataReader rows to corresponding C# classes. SQL-queries are generated dynamically.
Asked
Active
Viewed 90 times
0
-
2Are you stuck with using `SqlDataReader` or can you migrate over to an ORM solution like [NHibernate](http://nhforge.org/) or [Entity Framework](http://msdn.microsoft.com/en-gb/data/ef.aspx#)? – Adam Houldsworth Jul 24 '13 at 13:28
-
I am particularly interested in the fastest solution. – Qué Padre Jul 24 '13 at 13:34
-
Fastest to write, fastest at runtime, what? And some times there are options that are "fast enough but far easier to do", is that acceptable? – Scott Chamberlain Jul 24 '13 at 13:35
-
fastest at runtime, that's the point... I am dealing with huge query results... – Qué Padre Jul 24 '13 at 13:43
1 Answers
1
SqlDataReader is not persistant, it's a firehose, designed for forward-only, read-only access to data. If you want to map SQL queries to classes you may need another approach like strongly typed datasets, LINQ2SQL etc.

Yuriy Galanter
- 38,833
- 15
- 69
- 136