[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Gregg Maggioli

8/2/2002 8:56:00 PM


I have a simple need to display an entire small table using MIT. I am
trying to use the ObjectList control but when I bind the data to the
ObjectList (via a datareader) I get a single column that is hyperlinked
to the details for that record. The data that I am binding is dynamic
so I cannot specify the column names to be displayed. How can I display
the entire contents of a small table.

This is the code I used to get the single hyperlinked column.

olstDryer.DataSource = dr
olstDryer.DataBind()

Thanks

*** Sent via Developersdex http://www.develop... ***
Don't just participate in USENET...get rewarded for it!
4 Answers

Richard Hatt

8/4/2002 6:00:00 PM

0

You can supply a list of column names to
olstDryer.LabelField, but you need to know what they are.

You could either fetch them from the database before the
datareader, or fill a dataset, use it to find out the
column names, and then bind the dataset to the
objectlist. Should not be a significant impact for a
small table.

>-----Original Message-----
>
>I have a simple need to display an entire small table
using MIT. I am
>trying to use the ObjectList control but when I bind the
data to the
>ObjectList (via a datareader) I get a single column that
is hyperlinked
>to the details for that record. The data that I am
binding is dynamic
>so I cannot specify the column names to be displayed.
How can I display
>the entire contents of a small table.
>
>This is the code I used to get the single hyperlinked
column.
>
> olstDryer.DataSource = dr
> olstDryer.DataBind()
>
>Thanks
>
>*** Sent via Developersdex http://www.develop...
***
>Don't just participate in USENET...get rewarded for it!
>.
>

Chris Moore

8/7/2002 11:29:00 PM

0

Very similar question:

Is it possible to use MIT's List control (as opposed to the ObjectList
control) to display multiple columns from a db query?

My code to get a single column:
lstLoads.DataSource = dr
lstLoads.DataBind()

Thanks,

Chris


"Richard Hatt" <richard.hatt@torex.com> wrote in message
news:0a4601c23bd0$073f23d0$3aef2ecf@TKMSFTNGXA09...
> You can supply a list of column names to
> olstDryer.LabelField, but you need to know what they are.
>
> You could either fetch them from the database before the
> datareader, or fill a dataset, use it to find out the
> column names, and then bind the dataset to the
> objectlist. Should not be a significant impact for a
> small table.



Aaron

8/8/2002 9:25:00 AM

0

TableFields can be used to specify which columns needed listing.
In detail, you can refer to MSDN.
"Gregg Maggioli" <greggm@magtech.com> ??????:uEsaQZlOCHA.2368@tkmsftngp10...
>
> I have a simple need to display an entire small table using MIT. I am
> trying to use the ObjectList control but when I bind the data to the
> ObjectList (via a datareader) I get a single column that is hyperlinked
> to the details for that record. The data that I am binding is dynamic
> so I cannot specify the column names to be displayed. How can I display
> the entire contents of a small table.
>
> This is the code I used to get the single hyperlinked column.
>
> olstDryer.DataSource = dr
> olstDryer.DataBind()
>
> Thanks
>
> *** Sent via Developersdex http://www.develop... ***
> Don't just participate in USENET...get rewarded for it!


Chris Moore

8/8/2002 3:14:00 PM

0

Just answered my own question. After a review of the documentation it looks
like an ObjectList is the only reasonable way to output multiple columns
from a table.


"Chris Moore" <chrism00@hotmail.com> wrote in message
news:e6cw#llPCHA.2368@tkmsftngp10...
> Very similar question:
>
> Is it possible to use MIT's List control (as opposed to the ObjectList
> control) to display multiple columns from a db query?
>
> My code to get a single column:
> lstLoads.DataSource = dr
> lstLoads.DataBind()
>
> Thanks,
>
> Chris