retrieve picture from sqlserver

Discussion in 'ASP .Net' started by Mike, Aug 31, 2003.

  1. Mike

    Mike Guest

    Hi to everyone,
    I have some image field in database and want to show it in a file.
    so i wrote some code:
    sqlReader.Read();

    Response.ContentType = (string)sqlReader["ContentType"];

    Response.OutputStream.Write((byte[])sqlReader["Picture"],0,Int32.Parse(sqlRe
    ader["ByteSize"].ToString()));

    Response.End();

    in runtime i haven't any massage of error, but at end i've got only image
    box with X and without some image.

    does enybody could explain my fault?
     
    Mike, Aug 31, 2003
    #1
    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. Kelly G.
    Replies:
    0
    Views:
    555
    Kelly G.
    Jan 8, 2004
  2. Kristofer Liljeblad
    Replies:
    0
    Views:
    615
    Kristofer Liljeblad
    Jun 30, 2003
  3. =?Utf-8?B?SmVmZnJleQ==?=

    Upgrading ASP w/SQLserver 2000 to ASP.NET w/ SQLserver 2005

    =?Utf-8?B?SmVmZnJleQ==?=, Apr 6, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    507
    sloan
    Apr 27, 2007
  4. Comfort

    Can't load/retrieve a picture from the database

    Comfort, Oct 7, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    106
    Ken Cox [Microsoft MVP]
    Oct 8, 2004
  5. Replies:
    8
    Views:
    1,323
    Mick White
    Apr 19, 2005
Loading...

Share This Page