Best way bind "data" without a database source

D

d[ - - ]b

Hi, not sure if this would be the right place. Kinda new to .net, but have
a task / exercise where we must use a datagrid, datalist etc (one of them)
without any invovlement of a database. We must use the contents of an array
to display the data in one of them. Which is possible / recommendable? I
can't find anything anywhere that doesnt state there must be a database as a
source. Can anyone please assist? Datalist looks possible, but only
examples i'm finding are extracting data from a db.

Thanks for your help you can offer
Naomi
 
D

d[ - - ]b

Nevermind (unless i'm wrong?).........Just make the datasource refer to the
array?
 
S

Scott Mitchell [MVP]

Nevermind (unless i'm wrong?).........Just make the datasource refer to the

Yep, the DataSource can be any object that implements IEnumerable, such
as an Array, an ArrayList, a Hashtable, etc., etc. In fact, you can
create your own classes that implement IEnumerable and bind them to the
DataGrid. See:

Displaying Custom Classes in a DataGrid
http://aspnet.4guysfromrolla.com/articles/102302-1.aspx

Happy Programming!

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 
D

d[ - - ]b

Cool. :D Thanks!

Scott Mitchell said:
Yep, the DataSource can be any object that implements IEnumerable, such
as an Array, an ArrayList, a Hashtable, etc., etc. In fact, you can
create your own classes that implement IEnumerable and bind them to the
DataGrid. See:

Displaying Custom Classes in a DataGrid
http://aspnet.4guysfromrolla.com/articles/102302-1.aspx

Happy Programming!

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,296
Latest member
HeikeHolli

Latest Threads

Top