Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8690173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:50:48+00:00 2026-06-12T23:50:48+00:00

My delete command isn’t deleting. When I click the delete button, I see the

  • 0

My delete command isn’t deleting. When I click the delete button, I see the Get and Post events fire, but no changes are reflected in my database, or on the page. If I assign a default value to the asp:Parameter the default value gets passed every time, and if it happens to exist in the database, the delete command evaluates properly and deletes the record.

<asp:SqlDataSource
    ID="AcknowledgementDataSource" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ProductionDatabaseConnectionString1 %>" 
    SelectCommand="select tblHRM_Acknowledgements.AcknowledgementID, tblHRM_Acknowledgements.Acknowledger, lstduperoncontacts.Contact as Acknowledgee, tblHRM_Acknowledgements.Comment from tblHRM_Acknowledgements left join lstduperoncontacts on tblHRM_Acknowledgements.acknowledgee = lstDuperonContacts.contactid where Acknowledger in (select lstDuperonContacts.ContactID from lstDuperonContacts where lstDuperonContacts.email = @lblemail)"
    InsertCommand="insert into tblHRM_Acknowledgements(Acknowledger, Acknowledgee, Comment) Select contactID, @ddlAck, @txtComment from lstDuperonContacts where email = @lblemail"         
    DeleteCommand="delete from tblHRM_Acknowledgements where tblHRM_Acknowledgements.AcknowledgementID = @AcknowledgementID">
        <SelectParameters>
            <asp:ControlParameter ControlID="lblemail" Name="lblemail" />
        </SelectParameters>
        <InsertParameters>
            <asp:ControlParameter ControlID="lblemail" Name="lblemail" />
            <asp:ControlParameter ControlId="ddlAcknowledgee" PropertyName="SelectedValue" Name="ddlAck" />
            <asp:ControlParameter ControlID="txtComment" Name="txtComment" />
        </InsertParameters>
        <DeleteParameters>
            <asp:Parameter Name="AcknowledgementID" />
        </DeleteParameters>

    </asp:SqlDataSource>

I feel like this is an obvious issue like a typo or something and I just can’t find it, but I can’t say for sure. Anything jump out as wrong?

Listview that displays/deletes data:

    <asp:ListView ID="ListView1" runat="server" DataSourceID="AcknowledgementDataSource">
        <AlternatingItemTemplate>
            <li style="">
                <asp:HiddenField ID="AcknowledgementField" Value='<%# Eval("AcknowledgementID") %>' runat="server" />
                Acknowledgee:
                <asp:Label ID="AcknowledgeeLabel" runat="server" 
                    Text='<%# Eval("Acknowledgee") %>' />
                <br />
                Comment:
                <asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment") %>' />
                <br />
                <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                    Text="Delete" />
            </li>
        </AlternatingItemTemplate>
        <EmptyDataTemplate>
            No data was returned.
        </EmptyDataTemplate>
        <ItemSeparatorTemplate>
            <br />
        </ItemSeparatorTemplate>
        <ItemTemplate>
            <li style="">
                <asp:HiddenField ID="AcknowledgementField" Value='<%# Eval("AcknowledgementID") %>' runat="server" />
                Acknowledgee:
                <asp:Label ID="AcknowledgeeLabel" runat="server" 
                    Text='<%# Eval("Acknowledgee") %>' />
                <br />
                Comment:
                <asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment") %>' />
                <br />
                <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" 
                    Text="Delete" />
            </li>
        </ItemTemplate>
        <LayoutTemplate>
            <ul ID="itemPlaceholderContainer" runat="server" style="">
                <li runat="server" id="itemPlaceholder" />
            </ul>
            <div style="">
            </div>
        </LayoutTemplate>
    </asp:ListView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:50:49+00:00Added an answer on June 12, 2026 at 11:50 pm

    Try this code

    <asp:ListView ID="ListView1" DataKeyNames="AcknowledgementID".......
    

    Use DataKeyNames property for listview.

    ListView.DataKeyNames Property

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I fire a delete command on Table A, and this A is being
If row is not selected and delete row command is issued in jqgrid, Please
Has anyone tried out working with the Delete and update command of SPDataSource used
How can I delete the hidden cropped elements from a pdf from command line?
I want to delete a directory in the repository via command line. At the
Is there any one command in Mongoid to delete an object using id? Something
When developing Pig scripts that use the STORE command I have to delete the
I want to delete a number of jobs from a q. The command to
I'm trying to start the del command using System.Diagnostic.Process. Basically I want to delete
I'm having a problem with in my class with generating delete command: private String

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.