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 8058905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:29:47+00:00 2026-06-05T09:29:47+00:00

I am referring this http://www.dotnetcurry.com/ShowArticle.aspx?ID=585 to retrieve image from sql server to window phone

  • 0

I am referring this http://www.dotnetcurry.com/ShowArticle.aspx?ID=585 to retrieve image from sql server to window phone and had error ArgumentNullException was unhandled when run it at the that higlighted row.

public class ImageConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            byte[] buffer = value as byte[];
            **Stream memStream = new MemoryStream(buffer);**
            WriteableBitmap wbimg = PictureDecoder.DecodeJpeg(memStream);
            return wbimg; 
        }
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return null; 
        }
    }

I had found another similar post had same error with me.
http://forums.create.msdn.com/forums/p/74224/452127.aspx
But don’t understand the coding..Anyone know how to solve the error?

  • 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-06-05T09:29:50+00:00Added an answer on June 5, 2026 at 9:29 am

    Looks like value is null or is not a byte array.

    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        WriteableBitmap wbimg = null;
    
        if (value != null && value is byte[]) {
            byte[] buffer = value as byte[];
            Stream memStream = new MemoryStream(buffer);
            wbimg = PictureDecoder.DecodeJpeg(memStream);
        }
    
        return wbimg; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering about the image effect seen on this site http://www.daffys.com/ I'm referring
Referring to this web site http://www.cplusplus.com/reference/std/utility/make_pair/ The std::make_pair has this signature (and possible implementation):
I am referring to this project by Jimmy Bogard: http://www.codeplex.com/AutoMapper The code repository site
I am referring this article: http://haacked.com/archive/2009/11/19/aspnetmvc2-custom-validation.aspx which shows how to create custom annotation in
I'm trying to create a page which looks somewhat like this: http://www.drmichaelbogdan.com/plastic-surgery/ (I'm referring
From this article http://www.stuartellis.eu/articles/erb referring to thread safety levels: At this level, the specified
I'm referring to this article here http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/ In my current application I have two
Referring to the below link: http://www.javaworld.com/javaworld/jw-11-1998/jw-11-techniques.html?page=2 The composition approach to code reuse provides stronger
the specific example i am referring to is this site http://www.iamextreme.net/category.php?CategoryId=1&SubCategoryId=0&SortBy=name notice the sort
What I'm referring to is a documented bug: http://www.google.com/support/forum/p/apps-apis/thread?tid=58c4f7fbe60be52c&hl=en . Basically, when I use

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.