Delete raise error

2 posts, 0 answers
  1. lakmal
    lakmal avatar
    76 posts
    Member since:
    Jun 2009

    Posted 04 Sep 2009 Link to this post

    Hi,

    When i goto delete record this error is raising why that?

    Incorrect syntax near '?'.


    this is my grid and datasource
     <telerik:RadGrid ID="RadGrid5" runat="server" AutoGenerateColumns="False"  AllowAutomaticInserts="True"
                                    AllowAutomaticUpdates="True" AllowAutomaticDeletes="false"
                                            GridLines="None" DataSourceID="SqlDataSource2" Width="400px"
                                    AllowSorting="True" Skin="Web20" >
                                    <MasterTableView AutoGenerateColumns="False" DataKeyNames="DocNo" CommandItemDisplay="TopAndBottom"
                                     AllowAutomaticDeletes="true" AllowAutomaticInserts="true" >
                                    
                                        <Columns>
                                                                                 
                                            <telerik:GridBoundColumn DataField="DocNo" HeaderText="Doc No" Visible="false" ReadOnly="true"
                                                UniqueName="DocNo">
                                            </telerik:GridBoundColumn>
                                            
                                          <telerik:GridTemplateColumn UniqueName="IDCcomID" HeaderText="Doc Own AppComment">                                        
                                            <ItemTemplate>                                        
                                             <telerik:RadComboBox runat="server"
                                                 ID="RadComp"
                                                 DataTextField="DocOwnAppComment"
                                                 DataValueField="DocOACID"
                                                 HighlightTemplatedItems="true"
                                                 Height="190px"
                                                 Width="220px"
                                                 DropDownWidth="420px"
                                                    DataSourceID="ContactsDataSource"
                                                    SelectedValue='<%#Bind("IDCcomID") %>'></telerik:RadComboBox>                                        
                                            </ItemTemplate>
                                            <EditItemTemplate>                                        
                                            <telerik:RadComboBox runat="server"
                                                 ID="RadCompEdit"
                                                 DataTextField="DocOwnAppComment"
                                                 DataValueField="DocOACID"
                                                 HighlightTemplatedItems="true"
                                                 Height="190px"
                                                 Width="220px"
                                                 DropDownWidth="420px"
                                                    DataSourceID="ContactsDataSource"
                                                    SelectedValue='<%#Bind("IDCcomID") %>'></telerik:RadComboBox>                                                
                                            
                                            </EditItemTemplate>                                        
                                            </telerik:GridTemplateColumn>                                
                                            
                                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmText="Are you sure delete this record?"
                                                Text="Delete" UniqueName="column">
                                            </telerik:GridButtonColumn>
                                           </Columns>
                                        
                                    </MasterTableView>
                                  </telerik:RadGrid>


     <asp:SqlDataSource ID="SqlDataSource2"
                                        ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>"
                                        SelectCommand="SELECT DocNo , [IDCcomID] FROM [tbl_DATA_IDCcomment] WHERE (DocNo = @DocNo)"
                                        DeleteCommand= "delete from  tbl_DATA_IDCcomment where DocNo = @DocNo and IDCcomID=?"
                                         runat="server">
                                       
                                      <SelectParameters>                                                                           
                                            <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="DocNo" />
                                        </SelectParameters>
                                         <DeleteParameters>
                                          <asp:Parameter Name="IDCcomID" Type="Int32" />
                                         
                                         </DeleteParameters>  
                                    </asp:SqlDataSource>





  2. lakmal
    lakmal avatar
    76 posts
    Member since:
    Jun 2009

    Posted 06 Sep 2009 Link to this post

    I found solution

    ClientDataKeyNames  is the solution
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top