Welcome Guest Search | Active Topics | Sign In | Register

ListBox with SqlDataSource doesn't display data. Options
Jim M
Posted: Tuesday, August 16, 2011 7:18:38 PM
Rank: Newbie
Groups: Member

Joined: 5/2/2010
Posts: 5
I'm confused. I thought the ListBox control can databind to a SQLDataSource control. But no data displays in the ListBox.

Below is the ListBox control code and the SqlDataSource code. What am I doing wrong???

Code: HTML/ASPX
<div style="width: 200px; height: 120px; font-family: Verdana; font-size: 12px; border: solid 1px #909090;
                                padding: 4px; background-color: white;">
                                <eo:ListBox ID="ListBox2" runat="server" ControlSkinID="None" 
                                    DataSourceID="SidingBrandData" DataTextField="Brand" DataValueField="Brand" 
                                    Height="100px" Width="200px">
                                    <BodyStyle CssText="border: solid 1px #c6c7d2;background-color:white;" />
                                    <DisabledItemStyle CssText="background-color:white; color: #c0c0c0; padding: 2px;" />
                                    <ItemStyle CssText="padding: 2px; background-color:white; color: black;" />
                                    <ListBoxStyle CssText="font-family:Tahoma; font-size:11px;" />
                                    <MoreItemsMessageStyle CssText="padding:2px;" />
                                    <SelectedItemStyle CssText="padding: 2px; background-color:#3399ff; color:white;" />
                                </eo:ListBox>
                             </div>

        <asp:SqlDataSource ID="SidingBrandData" runat="server" ConnectionString="<%$ ConnectionStrings:3mDatabaseConnectionString %>"
            SelectCommand="SELECT [Brand] FROM [Siding Component Brand] ORDER BY [Brand]">
        </asp:SqlDataSource>
eo_support
Posted: Wednesday, August 17, 2011 11:26:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We have confirmed this to be a bug. We will fix it and post an update build as soon as possible.

Thanks!
Jim M
Posted: Wednesday, August 17, 2011 1:04:10 PM
Rank: Newbie
Groups: Member

Joined: 5/2/2010
Posts: 5
Thanks.... Do you have a suggested work-around until this fix and the update build is available?
eo_support
Posted: Wednesday, August 17, 2011 1:51:38 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You would need to use a DataTable instead of SqlDataSource. In another word, declarative data source doesn't work in this build. So you must set its DataSource to an ADO.NET object such as DataTable and call DataBind explicitly.

Thanks
Jim M
Posted: Wednesday, August 17, 2011 3:20:58 PM
Rank: Newbie
Groups: Member

Joined: 5/2/2010
Posts: 5
Thank you!
eo_support
Posted: Saturday, August 20, 2011 10:31:00 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We have posted a new build that should fix this problem. You can download it from our download page.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.