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

  • Home
  • SEARCH
  • 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 8975771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:57:52+00:00 2026-06-15T18:57:52+00:00

I am trying to delete records from my table but unable to do so.

  • 0

I am trying to delete records from my table but unable to do so. I have window form with Insert, Update, Delete and Save button. I can insert data but I can’t delete specific or any records from that table. Below is my code.

Whenever I click ‘delete’ button I get (“Error while deleting record on table…” & ex.Message, “Delete Records”) msgbox only.

Am I missing something? Please advise. Any help would be great. Thank you!

Private Sub Deletebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Deletebtn.Click

    Dim con As New SqlConnection
    Dim cmd As New SqlCommand
    Try
        con.ConnectionString = "Server=USRAG-L-0067215\SQLEXPRESS;Database=Alamo Products_Design Data;Trusted_Connection=True"
        con.Open()
        cmd.Connection = con
        cmd.CommandText = "Delete From Design_Parameters where DesignID= ? "
        cmd.ExecuteNonQuery()
        If MessageBox.Show("Do you really want to Delete this Record?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = DialogResult.No Then

            MsgBox("Operation Cancelled")

            Exit Sub

        End If
    Catch ex As Exception
        MessageBox.Show("Error while deleting record on table..." & ex.Message, "Delete Records")

    Finally

        con.Close()
    End Try
End Sub

End Class

  • 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-15T18:57:53+00:00Added an answer on June 15, 2026 at 6:57 pm

    you need to add parameter for DesignID

    Dim con As New SqlConnection
        Dim cmd As New SqlCommand
        Try
            con.ConnectionString = "Server=USRAG-L-0067215\SQLEXPRESS;Database=Alamo Products_Design Data;Trusted_Connection=True"
            con.Open()
            cmd.Connection = con
            cmd.CommandText = "Delete From Design_Parameters where DesignID= @DesignID"
        cmd.Parameters.Add(New SqlParameter("@DesignID", yourvaluehere))
            cmd.ExecuteNonQuery()
            If MessageBox.Show("Do you really want to Delete this Record?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) = DialogResult.No Then
    
                MsgBox("Operation Cancelled")
    
                Exit Sub
    
            End If
        Catch ex As Exception
            MessageBox.Show("Error while deleting record on table..." & ex.Message, "Delete Records")
    
        Finally
    
            con.Close()
        End Try
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to delete the records from the users table in mysql, the
I'm trying to delete all the records from a table using this approach: new
I am trying to create a delete query to remove records from one table,
I'm trying to delete records from a table that is getting to much spam.
I'm trying to delete records from a table if there are more than 15
I am trying to delete the all record from the table in database, but
I am trying to delete MySQL table rows from a Web page using Perl.
I was trying to delete a record from a table in AS/400 database. I
I keep getting these errors when trying to delete rows from a table. The
I am trying to delete all records that match a quiz id from the

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.