Image Loading from SQL Server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?VW1lc2huYXRo?=

    Image Loading from SQL Server

    Hi,
    How can I load a image stored in SQL server database in ASP.NET page. I
    have used Response.Binary Write but it loads in a new page .I want to load in
    a part of my aspx page or in a control (image etc).
    Is it possible to load in any grid control?

    Thanks in advance
    Umeshnath V.G.

  • Michael Nemtsev

    #2
    Re: Image Loading from SQL Server

    Hello Umeshnath,

    I suppose u need to use ASP.NET AJAX to update your image in page without
    updating all page

    ---
    WBR, Michael Nemtsev [.NET/C# MVP].
    My blog: http://spaces.live.com/laflour
    Team blog: http://devkids.blogspot.com/

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo

    UHi,
    UHow can I load a image stored in SQL server database in ASP.NET page.
    UI
    Uhave used Response.Binary Write but it loads in a new page .I want to
    Uload in
    Ua part of my aspx page or in a control (image etc).
    UIs it possible to load in any grid control?


    Comment

    • Eliyahu Goldin

      #3
      Re: Image Loading from SQL Server

      You need to make a separate page GetImage.aspx that will accept an image id
      as a query parameter. You will refer to your images like
      <img src="GetImage.a spx?id=123" />

      The page will get images from the database and stream them down with
      Response.Binary Write. The images will land into the controls referring them.

      --
      Eliyahu Goldin,
      Software Developer & Consultant
      Microsoft MVP [ASP.NET]




      "Umeshnath" <Umeshnath@disc ussions.microso ft.comwrote in message
      news:51A49F3C-B918-412A-900A-966677F8C59F@mi crosoft.com...
      Hi,
      How can I load a image stored in SQL server database in ASP.NET page. I
      have used Response.Binary Write but it loads in a new page .I want to load
      in
      a part of my aspx page or in a control (image etc).
      Is it possible to load in any grid control?
      >
      Thanks in advance
      Umeshnath V.G.
      >

      Comment

      • Patrice

        #4
        Re: Image Loading from SQL Server

        Do you know how to make it work with a usual image ? Do the same and then
        change just the image url to point to the page that serves this image.

        (the idea is that the control translates to an html img tag that points to
        the image location, the image location can be a page that serves an image).

        --
        Patrice


        "Umeshnath" <Umeshnath@disc ussions.microso ft.coma écrit dans le message de
        news: 51A49F3C-B918-412A-900A-966677F8C59F@mi crosoft.com...
        Hi,
        How can I load a image stored in SQL server database in ASP.NET page. I
        have used Response.Binary Write but it loads in a new page .I want to load
        in
        a part of my aspx page or in a control (image etc).
        Is it possible to load in any grid control?
        >
        Thanks in advance
        Umeshnath V.G.
        >

        Comment

        • Alexey Smirnov

          #5
          Re: Image Loading from SQL Server

          On Jul 3, 2:42 pm, Umeshnath <Umeshn...@disc ussions.microso ft.com>
          wrote:
          have used Response.Binary Write but it loads in a new page
          place your code in SqlImage.aspx and configure your Image Control to
          call that page

          <asp:Image ImageUrl="SqlIm age.aspx"...

          Comment

          • sloan

            #6
            Re: Image Loading from SQL Server

            Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


            You may have to google some, but Jeff Prosise puts the "Not So Good" label
            on something like this:

            <img src=<% SomePage.aspx?I D=123 %>



            and suggests using a custom http module:
            Find this files in the example listed above:

            NorthwindImageG rabber.ashx 1 KB
            PictureGridView .aspx 2 KB
            PictureGridView .aspx.cs




            This was fresh/cool stuff from TechEd2007 FYI.





            "Umeshnath" <Umeshnath@disc ussions.microso ft.comwrote in message
            news:51A49F3C-B918-412A-900A-966677F8C59F@mi crosoft.com...
            Hi,
            How can I load a image stored in SQL server database in ASP.NET page. I
            have used Response.Binary Write but it loads in a new page .I want to load
            in
            a part of my aspx page or in a control (image etc).
            Is it possible to load in any grid control?
            >
            Thanks in advance
            Umeshnath V.G.
            >





            Comment

            Working...