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

Display datasource errors for debugging?

2 Answers 169 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lenny_shp
Top achievements
Rank 2
Lenny_shp asked on 16 Sep 2014, 03:02 PM
I am getting a "bind variable does not exist" error from Oracle under the example with 1 parameter.   I even tried to assign parameter value in
srcEmployee_Updating method.     AllowAutomaticUpdates="true"

            OracleCommand cmd = (OracleCommand)e.Command;
            cmd.Parameters["location_code"].Value = "abc";

Is there a debugging mode to see what RadGrid is creating to talk to datasource for automatic updates?

    <asp:SqlDataSource ID="srcEmployee" runat="server"  ProviderName="Oracle.ManagedDataAccess.Client" DataSourceMode="DataSet"
        UpdateCommand="UPDATE mytable SET location = :location_code'">
        <UpdateParameters>
            <asp:Parameter Name="location_code" DbType="String"  Direction="Input" DefaultValue="empty" ConvertEmptyStringToNull="true" />
        </UpdateParameters>
    </asp:SqlDataSource>

                  <telerik:GridTemplateColumn HeaderText="Location Code" HeaderStyle-Width="100px" UniqueName="location_code" DataField="location_code" DataType="System.String">
                        <ItemTemplate>
                            <%# Eval("location_code") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadDropDownList runat="server" ID="LocationDropDown" DataValueField="location_code" DataTextField="location_code" Width="100px"
                                 DataSourceID="srcLOV">
                            </telerik:RadDropDownList>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>

2 Answers, 1 is accepted

Sort by
0
Lenny_shp
Top achievements
Rank 2
answered on 16 Sep 2014, 03:41 PM
Through _Updating event I found out it's including this additional parameter defined in RadGrid1 DataKeyNames  (e.g.  UserID)
But UserID was not specified in UpdateCommand.
0
Angel Petrov
Telerik team
answered on 19 Sep 2014, 01:33 PM
Hello,

Based on the information provided it would be hard to tell what exactly is causing the unwanted behavior. In order to determine whether the problem is related with the grid or something else in the setup I would like to ask you to replace the RadGrid with an ASP GridView and test the page again. If the issue is not reproducible then please share with us the entire page contents(markup and code-behind) so we could examine the implementation.

Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Lenny_shp
Top achievements
Rank 2
Answers by
Lenny_shp
Top achievements
Rank 2
Angel Petrov
Telerik team
Share this question
or