Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello Friends!!


i want to program a delete button that will delete records in a database , the database name is profileTBL , help me please...

i tried this code but it seems that there is an error...

What I have tried:

Private Sub dltbtn_Click(sender As Object, e As EventArgs) Handles dltbtn.Click
       confirm = MsgBox("do you want to delete the student profile", vbYesNo + vbCritical, "deletion confimation")
       If confirm = vbYes Then
           rs.Delete(ADODB.AffectEnum.adAffectCurrent)
           MsgBox("Record has been deleted successfully!!!", vbInformation, "message")
           rs.Update()
           Refresh()
       Else
           MsgBox("Profile not deleted", vbInformation, "message")
       End If
   End Sub
Posted
Updated 10-Sep-18 3:17am
Comments
OriginalGriff 5-Sep-18 7:14am    
What error?
Where?
When?

"there is an error" is one of the most useless problem reports we get - and we get it a lot. It tells us nothing about what is happening, or when it happens.
So tell us what it is doing that you didn't expect, or not doing that you did.
Tell us what you did to get it to happen.
Tell us any error messages.
Tell us what you have tried to find out why.

Use the "Improve question" widget to edit your question and provide better information.
Simon_Whale 5-Sep-18 7:15am    
you need to include more information! what type of database technology are you using? TableAdapters? ADO.NET? Entity Framework

without this type of information all we can do is guess what you are using and it will be more than likely be incorrect advice.
Richard Deeming 5-Sep-18 12:03pm    
Don't use ADODB in a .NET application. That's an ancient and unsupported technology from the distant past. Use ADO.NET[^] instead.
[no name] 5-Sep-18 17:06pm    
It "seems" that there is an error ...

And if there isn't? What then? What do you want people to do in the meantime? Wait?

1 solution

Start here: CRUD + .NET[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900