Link to home
Start Free TrialLog in
Avatar of scm0sml
scm0sml

asked on

list(of object) vs IEnumerable(Of Object)

Hi,

I have always used list(of customobject).

Can someone tell me what the difference is between that and Ienumrable(of customobject) and how they would be used differently?

Have just upgraded to .net for using vb.net and would like to make sure i am still using the right thing.

Thanks
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

The List implements IEnumerable interface.
Avatar of scm0sml
scm0sml

ASKER

so basically list is fine unless there is a large amount of data being returned...as in huge?!
Holding a huge collection (of any type) of custom objects in memory is not a good idea anyway.
Avatar of scm0sml

ASKER

so if i wanted to pull them out of a db and display them on a page I would use...........?
DataTable.
Avatar of scm0sml

ASKER

so if i am using oo'd approach....

rather than have maybe a loadall() that returned a list of objects, you would still use a datatable?
That really depends. In my projects, even though I am using LINQ to SQL, I use stored procedures and datatables for showing lists of objects.
Avatar of scm0sml

ASKER

mmmm

I'm using n-tier so will return list of objects from my business layer.

Is there an industry standard these days?
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scm0sml

ASKER

Riight ok great thanks for all your input.
Glad to help :-)