SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: datalist

  1. #1
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    datalist

    Ok, I am populating a page with data from four different tables. I sarted out using a datalist and selected all the data I need with a stored procedure. Then I discovered that three of the tables have more than one record for each userID. This caused my datalist to display all of my data over and over again. I would like to use a repeater for the tables that have repeating records but then I am confused on how to display the page if:

    -table 1 has only 1 record per userID
    -table 2 has more than one record per userID
    -table 3 has more than one record per userID
    -table 4 has more than one record per userID

    ...and my page is layed out something like this

    some information from table 1 then information from table 3 then some more information from table 1 then information from table 2 then some more information from table 1 then information from table 4 then some more information from table 1

    Is there a way to keep all of table 1 in a datalist and then just pop in as asp:repeater for tables 2-4?

    this is how I am doing the datalist for table 1
    Code:
    GlobalConnection.Open()
            dtrProfile = cmdSelect.ExecuteReader()
            dlstProfile.DataSource = dtrProfile
            dlstProfile.DataBind()
            dtrProfile.Close()
    this is how I am doing the code for the asp:repeater
    Code:
    GlobalConnection.Open()
            dtrPositions = cmdPositions.ExecuteReader()
            dlstPositions.DataSource = dtrPositions
            dlstPositions.DataBind()
            dtrPositions.Close()
    I just want to make sure I am doing this the most efficient way.

  2. #2
    SitePoint Guru asterix's Avatar
    Join Date
    Jun 2003
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the database forum, not the asp.net forum.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •