If my image from the DB is null I get the following:
Unable to cast object of type 'System.DBNull' to type 'System.Byte[]' “
If I do end up having an image, no image displays. I am retrieving the information from a stored procedure. All other information comes through fine except the image.
Any help would be appreciated.
<telerik:RadListView ID="RadListSearchresults" runat="server" ItemPlaceholderID="PlaceHolder1" AllowPaging="true" Skin="Default" PageSize="8" >
<LayoutTemplate>
<div >
<asp:Panel ID="SResults" runat="server">
<div>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</div>
<br />
</asp:Panel>
</div>
</LayoutTemplate>
<ItemTemplate>
<fieldset style="float: left; width: 280px;">
<legend>Item:
<%
#Eval("Nomenclature")%>
</legend>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td style="width: 25%">
NSN:
</td>
<td style="width: 50%">
<%
#Eval("NSN")%>
</td>
</tr>
<tr>
<td>
MCN:
</td>
<td>
<%
#Eval("MCN")%>
</td>
</tr>
<tr>
<td>
Slamis:
</td>
<td>
<%
#Eval("Slamis")%>
</td>
</tr>
<tr>
<td>
LIN:
</td>
<td>
<%
#Eval("LIN")%>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" Text="Edit" /></td>
</tr>
</table>
</td>
<td align="right" style="width: 25%;padding-left: 10px;">
<telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AlternateText="Photo Not Found" DataValue='<%#Eval("Img") %>'
ToolTip='<%#Eval("ImgName", "Photo of {0}") %>' Width="90px" Height="110px" AutoAdjustImageControlSize="false"
/>
</td>
</tr>
</table>
</fieldset>
</ItemTemplate>
</telerik:RadListView>