Error While Binding the Images

2 posts, 0 answers
  1. Syed Danish
    Syed Danish avatar
    70 posts
    Member since:
    Dec 2009

    Posted 23 Sep 2011 Link to this post

    Hi All,

    I am trying to fetch the images from database, if no images are available from the data base it is showing "DBNull' Error.

    If I write the following code snippet with in the binding value '<%#Eval(Picture):null?Null:Eval("Picture")%> then all the images which even have the content are not getting displayed as required. Please do help me out of this problem.

    Syed Danish
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 23 Sep 2011 Link to this post


    please check with below code snippet.
    DataValue='<%# Eval("Picture") == null ? null : ((Binary) Eval("Picture")).ToArray() %>'

    ImageUrl  = '<%# Eval("Picture") == null ? null : Eval("Picture") %>'

    let me know if any concern.

    Jayesh Goyani
  3. DevCraft R3 2016 release webinar banner
Back to Top