This is a migrated thread and some comments may be shown as answers.

Error on dbtype image

1 Answer 125 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dyt Iscus
Top achievements
Rank 1
Dyt Iscus asked on 09 Dec 2009, 12:06 PM
Hello,

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

        [Telerik.OpenAccess.FieldAlias("blobBinaryData")]  
        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" />  
    </extension>  
  </field> 

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

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?

Cheers
Carol


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

1 Answer, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 10 Dec 2009, 03:34 PM
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:

[Telerik.OpenAccess.DefaultFetchGroup]
private byte[] blobBinaryData;

Best wishes,
Petar
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.
Tags
Getting Started
Asked by
Dyt Iscus
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or