HELP With DataList

Discussion in 'ASP .Net Web Controls' started by CCORDON, Dec 16, 2004.

  1. CCORDON

    CCORDON Guest

    I am using a DataList to load data from a OleDbDataReader but it wont load
    the data...I have checked and the DataReader has records in it.

    Here is the code:




    If Not Me.IsPostBack Then

    BiddingsReader =
    GetCurrentBiddings(p_UserInformation.UserCorpId)

    BiddingsReader.Read()

    If BiddingsReader.HasRows Then

    lstBiddings.DataSource = BiddingsReader

    lstBiddings.DataBind()

    lblNoData.Visible = False

    lstBiddings.Visible = True

    Else

    lblNoData.Visible = True

    lstBiddings.Visible = False

    End If

    End If




    This code is called in Page_Load

    Inside the HTML portion I am using



    <%# DataBinder.Eval(Container.DataItem, "Codigo") %>



    Where I want the data to appear

    Help is appreciated.

    Thanks
     
    CCORDON, Dec 16, 2004
    #1
    1. Advertising

  2. You should get the data into a datatable using a dataadapter. The DataList
    isn't going to want to deal with a datareader that way.


    "CCORDON" <> wrote in message
    news:...
    >I am using a DataList to load data from a OleDbDataReader but it wont load
    >the data...I have checked and the DataReader has records in it.
    >
    > Here is the code:
    >
    >
    >
    >
    > If Not Me.IsPostBack Then
    >
    > BiddingsReader =
    > GetCurrentBiddings(p_UserInformation.UserCorpId)
    >
    > BiddingsReader.Read()
    >
    > If BiddingsReader.HasRows Then
    >
    > lstBiddings.DataSource = BiddingsReader
    >
    > lstBiddings.DataBind()
    >
    > lblNoData.Visible = False
    >
    > lstBiddings.Visible = True
    >
    > Else
    >
    > lblNoData.Visible = True
    >
    > lstBiddings.Visible = False
    >
    > End If
    >
    > End If
    >
    >
    >
    >
    > This code is called in Page_Load
    >
    > Inside the HTML portion I am using
    >
    >
    >
    > <%# DataBinder.Eval(Container.DataItem, "Codigo") %>
    >
    >
    >
    > Where I want the data to appear
    >
    > Help is appreciated.
    >
    > Thanks
    >
     
    Ken Cox [Microsoft MVP], Dec 19, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gönen EREN

    Datalist in Datalist How?

    Gönen EREN, Aug 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    425
    Gönen EREN
    Aug 22, 2003
  2. acko bogicevic

    DataList in DataList

    acko bogicevic, Nov 10, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    5,570
    acko bogicevic
    Nov 11, 2003
  3. Steve Lloyd
    Replies:
    1
    Views:
    720
    Rick Spiewak
    May 26, 2004
  4. Nevyn Twyll
    Replies:
    8
    Views:
    1,972
  5. Luis Esteban Valencia
    Replies:
    1
    Views:
    505
    John Saunders
    Jan 6, 2005
Loading...

Share This Page