I'm having a debate with another programmer I work with.
For a database return type, are there any significant memory usage or performance differences, or other cons which should make someone avoid using the DataSets and DataTables and favour types which implement IEnumerable<T>
... or vice versa
I prefer returning types which implementIEnumerable<T>
(List<T>, T[] etc
) because it's more lightweight, strongly typed to the object when accessing properties, allows richer information about the underlying type etc. They do take more time to set up though when manually using the data reader.
Is the only reason to use DataTables these day just lazyness?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…