We help IT Professionals succeed at work.
Get Started

How delete a record using ASP 4.0 then refresh GridView

Last Modified: 2012-05-11
I am writing an asp 4.0 web site that will allow the users to add, change, and delete records from certain SQL  tables.  On one of the pages there is a GridView control with a "Select" link control on each row.  When the user clicks the Select control, that row's cells values are filled into some text boxes below the gridview and the user can then add, change, or delete the record.

I have tried using the Add, Change, and Delete features of the gridview control, but do not find them easy for the users.  So I am filling in these text boxes below the gridview and allowing the users to make their changes.

With that said, how do I delete a record in a SQL table when the user clicks the Delete button?  Once the user clicks the Delete button, the record should be removed from the SQL table and the gridview refreshed.

I am using the VB Code Behind method.   Here is the event that is triggered when the user clicks the Delete button:

    Protected Sub btnDelete_Click(sender As Object, e As System.EventArgs) Handles btnDelete.Click
         (What goes here?)
    End Sub

Thank you
Watch Question
This problem has been solved!
Unlock 1 Answer and 10 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE