Blob

Discussion in 'ASP .Net' started by ichor, Nov 1, 2003.

  1. ichor

    ichor Guest

    hi
    i have a blob field in my database and am able to display it on my asp.net
    page
    i would like to know how can i position the Blob on the page or can i use an
    image object?


    byte[] Picture;
    Picture = (byte[])dr["logo"];
    Response.Buffer=true;
    Response.ContentType = "Image/JPEG"; //after i set this i cant even get a
    response.write to work on mypage.
    Response.BinaryWrite(Picture);
    is there any way i can put this picture in an imagebutton?


    thanx
    ichor, Nov 1, 2003
    #1
    1. Advertising

  2. You can't mix content types. Once you've set the content type of your page to image/jpeg, you can't use Response.Write and expect normal HTML content.

    Instead - server the image from an external linked ASP.NET page and link it in an <img> tag.

    E.g.

    <img src="mydynamicimage.aspx?id=4" />

    Hope that helps.

    Cheers,
    Wim Hollebrandse
    http://www.wimdows.net
    http://www.wimdows.com

    ---
    Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
    Wim Hollebrandse, Nov 2, 2003
    #2
    1. Advertising

  3. ichor

    ichor Guest

    thanx works well...
    i just wanted to know what are the advantages of storing the images in a
    blob as opposed to storing the filepath in the table and retrieving the
    image from there.
    thanx for your help
    ichor, Nov 2, 2003
    #3
  4. There are only DISadvantages to storing images in a BLOB field at this time,
    due to the processing overhead involved in storing and fetching binary data
    from a database rather than the file system. Perhaps with Longhorn, this
    will change.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Big Things are made up of
    Lots of Little Things.

    "ichor" <> wrote in message
    news:...
    > thanx works well...
    > i just wanted to know what are the advantages of storing the images in a
    > blob as opposed to storing the filepath in the table and retrieving the
    > image from there.
    > thanx for your help
    >
    >
    Kevin Spencer, Nov 3, 2003
    #4
  5. ichor

    ichor Guest

    When is it longhorn scheduled to be released?
    thanx

    "Kevin Spencer" <> wrote in message
    news:...
    > There are only DISadvantages to storing images in a BLOB field at this

    time,
    > due to the processing overhead involved in storing and fetching binary

    data
    > from a database rather than the file system. Perhaps with Longhorn, this
    > will change.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > http://www.takempis.com
    > Big Things are made up of
    > Lots of Little Things.
    >
    > "ichor" <> wrote in message
    > news:...
    > > thanx works well...
    > > i just wanted to know what are the advantages of storing the images in a
    > > blob as opposed to storing the filepath in the table and retrieving the
    > > image from there.
    > > thanx for your help
    > >
    > >

    >
    >
    ichor, Nov 4, 2003
    #5
  6. I wouldn't hold my breath. Windows Server 2003 just came out!

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Big Things are made up of
    Lots of Little Things.

    "ichor" <> wrote in message
    news:...
    > When is it longhorn scheduled to be released?
    > thanx
    >
    > "Kevin Spencer" <> wrote in message
    > news:...
    > > There are only DISadvantages to storing images in a BLOB field at this

    > time,
    > > due to the processing overhead involved in storing and fetching binary

    > data
    > > from a database rather than the file system. Perhaps with Longhorn, this
    > > will change.
    > >
    > > --
    > > HTH,
    > >
    > > Kevin Spencer
    > > Microsoft MVP
    > > .Net Developer
    > > http://www.takempis.com
    > > Big Things are made up of
    > > Lots of Little Things.
    > >
    > > "ichor" <> wrote in message
    > > news:...
    > > > thanx works well...
    > > > i just wanted to know what are the advantages of storing the images in

    a
    > > > blob as opposed to storing the filepath in the table and retrieving

    the
    > > > image from there.
    > > > thanx for your help
    > > >
    > > >

    > >
    > >

    >
    >
    Kevin Spencer, Nov 4, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Vabo

    .NET and Oracle BLOB

    Robert Vabo, Aug 20, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    6,012
    Mark Kamoski
    Aug 27, 2003
  2. Steve
    Replies:
    0
    Views:
    440
    Steve
    Nov 27, 2003
  3. Jonathan
    Replies:
    4
    Views:
    1,081
    bruce barker
    Dec 15, 2004
  4. Earl Teigrob
    Replies:
    3
    Views:
    8,954
    Earl Teigrob
    Jan 6, 2004
  5. martin

    casting BLOB to a string

    martin, Jan 16, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    398
    mikeb
    Jan 19, 2004
Loading...

Share This Page