0

I have a GridView. It's connected to a SqlDataSource. My database is Oracle.

When I run the webpage, SELECT command works and I see the items in the list. When I click Delete button, I get this error:

ORA-01036: illegal variable name/number

Here is my GridView and SqlDataSource:

<telerik:RadAjaxPanel ID="ajaxMyLinks" runat="server" width="100%" LoadingPanelID="RadAjaxLoadingPanel1">
     <telerik:RadGrid ID="gridMyLinks" runat="server" DataSourceID="SqlDataSourceMyLinks" AllowAutomaticDeletes="True" AllowPaging="True" BackColor="White" BorderColor="White" PageSize="5" ShowHeader="False">
         <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSourceMyLinks" DataKeyNames="N_USER_LINK_ID">
             <Columns>
                 <telerik:GridHyperLinkColumn AllowSorting="False" DataNavigateUrlFields="V_LINK" DataNavigateUrlFormatString="{0}" DataTextField="V_LINK_TITLE" DataTextFormatString="{0}" FilterControlAltText="Filter column column" UniqueName="column" Target="_blank">
                 </telerik:GridHyperLinkColumn>
                 <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ImageUrl="Content/images/delete.png" UniqueName="column1">
                 </telerik:GridButtonColumn>
             </Columns>
         </MasterTableView>
         <PagerStyle Mode="NextPrev" ShowPagerText="False" />
     </telerik:RadGrid>
 </telerik:RadAjaxPanel>
<asp:SqlDataSource ID="SqlDataSourceMyLinks" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>" SelectCommand="SELECT V_LINK_TITLE, V_LINK, N_USER_LINK_ID FROM TAPP_IFH_USER_LINK WHERE (N_USER_ID = :USER_ID) ORDER BY N_USER_LINK_ID DESC" DeleteCommand="DELETE FROM TAPP_IFH_USER_LINK WHERE (N_USER_LINK_ID = :USER_LINK_ID)" ProviderName="<%$ ConnectionStrings:DefaultConnection.ProviderName %>">
  <DeleteParameters>
      <asp:Parameter Name="USER_LINK_ID" Type="Int32"></asp:Parameter>
  </DeleteParameters>
  <SelectParameters>
      <asp:SessionParameter Name="USER_ID" SessionField="USER_ID" />
  </SelectParameters>
</asp:SqlDataSource>

1 Answer 1

1

Found the solution. Parameter names were not matching between column name in DB and parameter. Parameter name was USER_LINK_ID while column name was N_USER_LINK_ID.

If this is not the problem in your case, check this post out. It has more suggestions

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.