Binding a DataSet to a web server repeater control

  • Thread starter Jon S via DotNetMonster.com
  • Start date
J

Jon S via DotNetMonster.com

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.
 
K

Karl Seguin [MVP]

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top