Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6948471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:49:37+00:00 2026-05-27T13:49:37+00:00

I am trying to display an image which is fetched from the database as

  • 0

I am trying to display an image which is fetched from the database as a binary stream, on the web form. Can you shed some light on this!

I am working on a project where users have profiles, and every user have their own profile picture displayed in the home page. THis picture comes from the database.

here is the code i have used to get the stream !

TestDBDataContext context1 = new TestDBDataContext();

            var r = (from a in context1.ImageTables where a.Id == 8 select a).First();

           MemoryStream stream = new MemoryStream(r.FileImage.ToArray());

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:49:38+00:00Added an answer on May 27, 2026 at 1:49 pm

    What I’ve done in the past is set the image url to an aspx page, like so:

    <img src="getLogo.aspx" alt="Logo" />
    

    Then, in the code-behind for getLogo.aspx, I’ve done the following:

    Response.BinaryWrite( imageData );
    Response.ContentType = "image/gif";
    

    Where imageData is your image as a byte array

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to display an image while I'm doing some Ajax updating (which I've
i am trying to display image from internet in my imageview. which is raising
I am trying to display an image from a URL, which may be larger
When trying to display a byte stream from HLDS (Half-Life Dedicated Server) in a
I am trying to display image, which is dynamically generated on client side with
It's me your junior programmer extraodinaire I'm trying to display an image from my
I am trying to use this answer from an old post: Display image from
I'm trying to display the biggest image url returned from an xml result. So
I am trying to make general purpose image display class which receives two parameters,
I'm trying to display an image that I load from a pixbuf( from data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.