Question: Gridview question (displaying data from a related "many" table)

C

Cirene

I have a gridview that displays a listing of cars for sale. It's based on a
"Cars" table.

(The "Cars" table has a 1 to many relationship to "CarPictures" table.)

On each gridview row (ie for each car) I want to show just 1 picture from
the "CarPictures" table.

Any suggestions as to how to do this?

I was thinking of selecting the TOP 1 picture from CarPictures table where
the CarId is a match and sticking the picture in a databound formview
control, but I didn't know how to query based on the current gridview row
(for each row).

Thanks!
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top