Error on dbtype image

Thread is closed for posting
2 posts, 0 answers
  1. Dyt Iscus
    Dyt Iscus avatar
    9 posts
    Member since:
    Jul 2005

    Posted 09 Dec 2009 Link to this post


    I have a problem with an db imagetype field. I have a view in sqlserver wich return several columns and a binary column. I want to bind the resultset as datasource to a radgrid, display several columns and the imagecolumn. For the image i'm using the radbinaryimage. When the code runs it returns rows but not for the binary column... It gives an error for that column when i watch the resultview while the other columns contain data

    +       base    {"No row for xxx.ECommerce.Data.TVWCalculatiesSub ('TVW_CalculatiesSub') GenericOID@9defac66 TVWCalculatiesMetSub ID=df97ede6-1e78-4104-8cb4-5c478be8f083"} System.Exception {Telerik.OpenAccess.Exceptions.NoSuchObjectException}  
    with Byte[]Fieldcolumn.Base.Base.Reason: NoSuchObject 

    I have the following mappings

            public byte[] BlobBinaryData  
                get { return blobBinaryData; }  
                set { this.blobBinaryData = value; }  
    and mapping.config  
      <field name="blobBinaryData">  
        <extension key="db-column">  
          <extension key="db-type" value="LONGVARBINARY" />  
          <extension key="db-column-name" value="blobBinaryData" />  

    and the following code in the grid
    <telerik:GridTemplateColumn DataField="BlobBinaryData" SortExpression="BlobBinaryData" UniqueName="BlobBinaryData">  
                    <asp:Label ID="BlobBinaryDataLabel" runat="server" meta:ResourceKey="BlobBinaryDataLabel" /> 
                    <telerik:RadBinaryImage runat="server" ImageHeight="80px" ImageWidth="80px" ReadOnly="True" Resizable="False" ResizeMode="Fit" DataValue='<%# Eval("BlobBinaryData") %>' /> 

    I have used binary image several times like this, the only difference is now i query on a view instead of a table. I can't find out why it isn't working can you help me?


    I investigated the error NoSuchObject and saw in the sqlprofiler that all dbtype image are left out in the query openaccess generates.
  2. PetarP
    PetarP avatar
    754 posts

    Posted 10 Dec 2009 Link to this post

    Hello Dyt Iscus,

    The image type field is not included in the default fetchplan. Because of that this field is not loaded and you cannot access it. We have intentionally left it out due to the fact that those kind of fields are mostly stored externally and we are trying to avoid the join when this is possible. If you would like to have the BlobBinaryData included in your query result you can just include the field in the default fetch plan. This can be done by placing this attribute on top of your field definition:

    private byte[] blobBinaryData;

    Best wishes,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top