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
ASP.NETVisual Basic.NET

Avatar of undefined
Last Comment
Nasir Razzaq

8/22/2022 - Mon
Nasir Razzaq

Nasir Razzaq

The List implements IEnumerable interface.
scm0sml

ASKER
so basically list is fine unless there is a large amount of data being returned...as in huge?!
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Nasir Razzaq

Holding a huge collection (of any type) of custom objects in memory is not a good idea anyway.
scm0sml

ASKER
so if i wanted to pull them out of a db and display them on a page I would use...........?
Nasir Razzaq

DataTable.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
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?
Nasir Razzaq

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.
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?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
ASKER CERTIFIED SOLUTION
Nasir Razzaq

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
scm0sml

ASKER
Riight ok great thanks for all your input.
Nasir Razzaq

Glad to help :-)