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

Binary Image Column and Oracle db

2 Answers 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kyle Koss
Top achievements
Rank 1
Kyle Koss asked on 24 Jul 2009, 04:12 PM
I have been trying to use the new GridBinaryImageColumn to display data in an Oracle table. After a few days of trying different things, I finally have it doing the inserts. I pretty much have to do the inserts manually as no matter how I tried I couldn't get the declaritve methods to work. My problem now is displaying the image in the grid column, the data is in the table, but the grid just displays it as a broken image, I guess it doesn't like the way Oracle returns the binary data (I have it stored in a BLOB column). I guess I need to know what I need to do, to get it to display the image correctly.

Here is the relevant part of the .aspx page:
<asp:ObjectDataSource ID="IssueScreenshotsDataSource" runat="server" TypeName="IssuesDataAccess" 
        DeleteMethod="DeleteIssueScreenshot" OldValuesParameterFormatString="original_{0}" 
        SelectMethod="GetIssueScreenshotsByIssueID">  
        <DeleteParameters> 
            <asp:Parameter Name="imageID" Type="Int32" /> 
        </DeleteParameters> 
        <SelectParameters> 
            <asp:Parameter Name="issueID" Type="Int32" /> 
        </SelectParameters> 
    </asp:ObjectDataSource> 

<
telerik:GridTableView DataKeyNames="imageID" DataSourceID="IssueScreenshotsDataSource" Width="100%" 
                    runat="server" CommandItemDisplay="Top" Name="Screenshots">  
                    <ParentTableRelation> 
                        <telerik:GridRelationFields DetailKeyField="issueID" MasterKeyField="issueId" /> 
                    </ParentTableRelation> 
                    <CommandItemSettings AddNewRecordText="Add A Screenshot" /> 
                    <Columns> 
                        <telerik:GridTemplateColumn HeaderText="Image Name" UniqueName="filename">  
                            <ItemTemplate> 
                                <asp:Label runat="server" ID="lblName" Text='<%# Eval("fileName") %>' /> 
                            </ItemTemplate> 
                            <EditItemTemplate> 
                                <telerik:RadTextBox runat="server" Width="200px" ID="txbName" Text='<%# Bind("fileName") %>' /> 
                                <asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" ControlToValidate="txbName" 
                                    ErrorMessage="Please, enter a name!" Display="Dynamic" SetFocusOnError="true" /> 
                            </EditItemTemplate> 
                            <HeaderStyle Width="30%" /> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridBinaryImageColumn DataField="data" HeaderText="Screenshot" UniqueName="screenshot" 
                            ImageAlign="NotSet" ImageHeight="60px" ImageWidth="60px" ResizeMode="Fit">  
                        </telerik:GridBinaryImageColumn> 
                        <telerik:GridButtonColumn ConfirmText="Are you sure you wish to delete this Screenshot?" 
                            ButtonType="imageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1">  
                            <ItemStyle HorizontalAlign="Center" /> 
                        </telerik:GridButtonColumn> 
                    </Columns> 
                </telerik:GridTableView> 
The select method returns a DataSet from an Oracle procedure:
PROCEDURE APPS_ISSUE_GET_SCRNSHOT_BY_FK (  
   p_issue_id   IN       NUMBER,  
   cur_out      OUT      sys_refcursor  
)  
IS 
BEGIN 
   OPEN cur_out FOR 
      SELECT image_id imageID, issue_id issueID, file_data data,  
             file_name fileName  
        FROM apps_issue_screenshots  
       WHERE (issue_id = p_issue_id);  
END

2 Answers, 1 is accepted

Sort by
0
Accepted
BaiH
Top achievements
Rank 1
answered on 29 Jul 2009, 10:22 AM
Did you add the image handler in the webconfig? It is the same handler as for the RadScriptManager.

<configuration>
   
<system.web>
       
<httpHandlers>
   
<add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" />
       
</httpHandlers>
   
</system.web>
</
configuration>

or

<system.webServer>

<handlers>

 
<add name="Telerik.Web.UI.WebResource"  path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" />

</handlers>
</
system.webServer>


-- BH


0
Kyle Koss
Top achievements
Rank 1
answered on 04 Aug 2009, 06:20 PM
Thank you very much, it works now. Although, there is nothing in the documentation or demos about having to do this if you want to use the GridBinaryImageColumn or the RadBinaryImage. I don't think I found anything about that in the forums either.
Tags
Grid
Asked by
Kyle Koss
Top achievements
Rank 1
Answers by
BaiH
Top achievements
Rank 1
Kyle Koss
Top achievements
Rank 1
Share this question
or