D
David
Hi all,
I am following this code...
http://www.devarticles.com/c/a/C-Sharp/Interface-IEnumerable-and-IEnumerator-in-C-sharp/2/
I have come to the part with public Customers(). I am assuming this is a
constructor (as it is the same name as the class).
In here, it says Get all customer ids from the database and put into an
arraylist. However, the code is for enumeration. To me, all data from a
database is enumerable, so why put into an arraylist?
What I want to do is to make this work with a datatable. Surely, I don't
need to enumerate each datarow in the datatable, just to put it into an
arraylist. If I am correct in my thinking, then how do I make this work with
a datatable instead of arraylist?
Thanks for your help. (Hopefully, this is not as difficult a problem as the
other one I raised in this group on 9th Nov, structure of website. That
issue is still a problem as well.)
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
I am following this code...
http://www.devarticles.com/c/a/C-Sharp/Interface-IEnumerable-and-IEnumerator-in-C-sharp/2/
I have come to the part with public Customers(). I am assuming this is a
constructor (as it is the same name as the class).
In here, it says Get all customer ids from the database and put into an
arraylist. However, the code is for enumeration. To me, all data from a
database is enumerable, so why put into an arraylist?
What I want to do is to make this work with a datatable. Surely, I don't
need to enumerate each datarow in the datatable, just to put it into an
arraylist. If I am correct in my thinking, then how do I make this work with
a datatable instead of arraylist?
Thanks for your help. (Hopefully, this is not as difficult a problem as the
other one I raised in this group on 9th Nov, structure of website. That
issue is still a problem as well.)
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available