HELP! Setting Datasource on UserControl generating error. This should be simple to do!

Last post 04-22-2006 11:13 AM by uga. 0 replies.

Sort Posts:

  • HELP! Setting Datasource on UserControl generating error. This should be simple to do!

    04-22-2006, 11:13 AM
    • Member
      35 point Member
    • uga
    • Member since 11-03-2004, 7:00 AM
    • Posts 7
    I have a user control with public property Rating that looks like this on the web page:

    <gui:FacilityThumb id="FacilityThumb" Rating='<%#Container.DataItem("numRatings")%>' runat="server" />

    I'm trying to set a DataSource on the FacilityThumb user control above so I can bind data to the Rating property. However when I do this in the web page's code behind file, I get the following error:
    Compiler Error Message: BC30456: 'DataSource' is not a member of 'System.Web.UI.UserControl'.

    ..on the following code:

                objCmd.Connection.Open()
                objReader = objCmd.ExecuteReader
                FacilityThumb.DataSource = objReader 
                FacilityThumb.DataBind()

    What am I doing wrong to get this error??
Page 1 of 1 (1 items)