Binding a DataSet to a web server repeater control

Discussion in 'ASP .Net' started by Jon S via DotNetMonster.com, Feb 15, 2006.

  1. Hi all

    In short, I have a dataset that contains 10 records and the relevant headings.
    All I want to do is bind this dataset to a asp.net repeater control. All the
    examples I've seen create table cell headings and then map to them headings
    like:

    <%#DataBinder.Eval(Container.DataItem, "CompanyName")%>,
    <%#DataBinder.Eval(Container.DataItem, "ContactName")%></font>

    I dont need to , and therefore haven't, created any headings as the dataset
    has them already. I just want to do something like this:
    CODE BEHIND CODE:
    this.repwscDayTop10.DataSource = dsDayTop10;
    this.repwscDayTop10.DataBind();

    WEB FORM CODE:
    <asp:Repeater id="repwscDayTop10" runat="server">
    <%#Container.DataItem%>
    </asp:Repeater>

    How do I do this? Is there any good links? Thanks in advance.

    --
    Message posted via DotNetMonster.com
    http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net/200602/1
     
    Jon S via DotNetMonster.com, Feb 15, 2006
    #1
    1. Advertising

  2. can you show us exactly what your dataset looks like? Are the "headings"
    just another row in the dataset (the first? the last?) or are they the
    actual column names? If it's the actual column names, just try using a
    datagrid with no templates or anything:

    <asp:datagrid id="x" runat="server" AutoGenerateColumns="true"/>

    Karl

    --
    http://www.openmymind.net/



    "Jon S via DotNetMonster.com" <u2272@uwe> wrote in message
    news:5be96dcf07dd1@uwe...
    > Hi all
    >
    > In short, I have a dataset that contains 10 records and the relevant
    > headings.
    > All I want to do is bind this dataset to a asp.net repeater control. All
    > the
    > examples I've seen create table cell headings and then map to them
    > headings
    > like:
    >
    > <%#DataBinder.Eval(Container.DataItem, "CompanyName")%>,
    > <%#DataBinder.Eval(Container.DataItem, "ContactName")%></font>
    >
    > I dont need to , and therefore haven't, created any headings as the
    > dataset
    > has them already. I just want to do something like this:
    > CODE BEHIND CODE:
    > this.repwscDayTop10.DataSource = dsDayTop10;
    > this.repwscDayTop10.DataBind();
    >
    > WEB FORM CODE:
    > <asp:Repeater id="repwscDayTop10" runat="server">
    > <%#Container.DataItem%>
    > </asp:Repeater>
    >
    > How do I do this? Is there any good links? Thanks in advance.
    >
    > --
    > Message posted via DotNetMonster.com
    > http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net/200602/1
     
    Karl Seguin [MVP], Feb 15, 2006
    #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. Donald Williamson

    Repeater Control Binding question

    Donald Williamson, Nov 14, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    600
    Guest
    Nov 19, 2003
  2. MeiMei
    Replies:
    0
    Views:
    589
    MeiMei
    Jan 20, 2004
  3. Charlie
    Replies:
    2
    Views:
    522
    Charlie
    Nov 2, 2004
  4. Brad Baker

    Problem binding dataset to a repeater

    Brad Baker, Oct 10, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    502
    Steven Cheng[MSFT]
    Oct 10, 2006
  5. MeiMei

    binding user control to Repeater web control

    MeiMei, Jan 19, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    136
    MeiMei
    Jan 19, 2004
Loading...

Share This Page