1->n relation display question

G

Guest

I'm a little bit confused as what is the bes way to achieve the following:
I have 2 database tables, table 1 product en table 2 image. For every
product record there can be 0-1 or more image records.

My question:
What is the best way to display the product record with the respective image
record(s)? Using a FormView for the product record and a GridView/DataList
for the image record(s)?
Or, writing own code (using Table, Row, Cells and within the cells the
controls like FileUpload, TextBox, ...) to save, edit, delete the data in the
two tables?

Thanks for your suggestions.
 
G

Guest

thanks for the info but

what do you mean with: just switch the gridview with a formview
 
S

sloan

I mean, the example KB I sent... they are using a Repeater as the control
with the nested data.


This is code from the KB

<asp:repeater id="childRepeater"
runat="server" datasource='<%#
Container.DataItem.Row.GetChildRows("myrelation") %>'>

<itemtemplate>
<%# Container.DataItem("title_id") %><br>
</itemtemplate>
</asp:Repeater>



Change this to a <asp:formview

but keep the datasource= ... syntax
 

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

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top