assigning ImageURL value of asp:image tag from DataReader

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default assigning ImageURL value of asp:image tag from DataReader

    Hello all, I'm using VB.NET, Access

    I have 20 images on a page, which are within nested tables. The images
    create a property map for a neighborhood.

    What I would like to accomplish is to set the ImageURL value of each image
    as I iterate through a Data Reader on pageLoad.

    I made a User Control which retrieves one value using a data reader, but
    that's 20 trips to the DB. It would seem that I should be able to retrieve
    all of the data at once when the page loads, then iterate through it to
    assign the ImageURL property for each asp:image, but I don't know the
    syntax.

    Any advice appreciated!
    Brandon


    Brandon Taylor Guest

  2. Similar Questions and Discussions

    1. Changing the width/height when using Hyperlink.ImageUrl
      I am using the ImageUrl property of the Hyperlink control to create a graphical Hyperlink. However, I want to change the size of the image I am...
    2. Collection Property problems with Image control ImageUrl property and URLBuilder
      Been using reflector and examining what Microsoft does with the Rows property in the Table class. It looks like all of the items added to the rows...
    3. More Collection Property problems with Image control ImageUrl property and URLBuilder
      After a few more hours of debugging I discovered that the URLBuilder solution that I mentioned previously does not work because there is no service...
    4. Changing ImageURL of Image Button which is added in template column of datagrid
      hello, I have a template column in my datagrid. To the header of template colum, i have added imagebutton. On click of the imagebutton , i...
    5. Hyperlink w/ImageUrl bug?
      I can't find any issue in the MS KB, but I'm experiencing the following problem which seems to be specific to IE5, and NOT any other version of IE...
  3. #2

    Default Re: assigning ImageURL value of asp:image tag from DataReader

    Why are using a datareader. If you have multiple calls on the page it seems
    to be a prime candidate for using a dataset and dataviews, which only
    require one trip to the DB

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "Brandon Taylor" <bt@btaylordesign.com> wrote in message
    news:d6if84$8pv$1@forums.macromedia.com...
    > Hello all, I'm using VB.NET, Access
    >
    > I have 20 images on a page, which are within nested tables. The images
    > create a property map for a neighborhood.
    >
    > What I would like to accomplish is to set the ImageURL value of each image
    > as I iterate through a Data Reader on pageLoad.
    >
    > I made a User Control which retrieves one value using a data reader, but
    > that's 20 trips to the DB. It would seem that I should be able to retrieve
    > all of the data at once when the page loads, then iterate through it to
    > assign the ImageURL property for each asp:image, but I don't know the
    > syntax.
    >
    > Any advice appreciated!
    > Brandon
    >
    >

    Paul Whitham TMM Guest

  4. #3

    Default Re: assigning ImageURL value of asp:image tag from DataReader

    Hi Paul,

    After doing a little more research, A DataSet with a Table seems the best
    choice. I'm not familiar with how to access the rows and columns of a
    DataTable so that I could iterate through them and then set the image
    sources in a for each loop, but I was thinking something like this:

    Dim intCount as integer = 0

    For Each dr As DataRow In Dataset.Tables("Table")

    imagename(-intCount.imageurl =
    Dataset.Tables("Images").row(intCount)("ImageURL") )

    intCount += 1

    Next

    I just need to know how to fill the DataTable once I have created the
    DataSet, and I think I can take it from there.


    "Paul Whitham TMM" <paul@valleybiz.net> wrote in message
    news:d6jhk5$nk6$1@forums.macromedia.com...
    > Why are using a datareader. If you have multiple calls on the page it
    > seems
    > to be a prime candidate for using a dataset and dataviews, which only
    > require one trip to the DB
    >
    > --
    > Regards
    >
    > Paul Whitham
    > Macromedia Certified Professional for Dreamweaver MX2004
    > Valleybiz Internet Design
    > [url]www.valleybiz.net[/url]
    >
    > Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    > [url]www.macromedia.com/support/forums/team_macromedia[/url]
    >
    > "Brandon Taylor" <bt@btaylordesign.com> wrote in message
    > news:d6if84$8pv$1@forums.macromedia.com...
    >> Hello all, I'm using VB.NET, Access
    >>
    >> I have 20 images on a page, which are within nested tables. The images
    >> create a property map for a neighborhood.
    >>
    >> What I would like to accomplish is to set the ImageURL value of each
    >> image
    >> as I iterate through a Data Reader on pageLoad.
    >>
    >> I made a User Control which retrieves one value using a data reader, but
    >> that's 20 trips to the DB. It would seem that I should be able to
    >> retrieve
    >> all of the data at once when the page loads, then iterate through it to
    >> assign the ImageURL property for each asp:image, but I don't know the
    >> syntax.
    >>
    >> Any advice appreciated!
    >> Brandon
    >>
    >>
    >
    >

    Brandon Taylor Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139