Above shows my Change Password Form.
It shows the user type, username and passwords stored in my database.
I want to know how to add details from this form to the database (Add New Button)
and also want to know how to delete them (Delete Button)
here is my code, I tried a few of own but it didnt work. pls help me
VB.NET:
Public Class frm_Change_Password
Private Sub frm_Change_Password_Move(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Move, Me.SizeChanged, Me.Shown
Dim r As Rectangle = Me.Bounds
r.Inflate(35, 35)
frm_BG1.Bounds = r
End Sub
Private Sub Username_PasswordBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Validate()
Me.Username_PasswordBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Username_PasswordDataSet)
End Sub
Private Sub frm_Change_Password_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Owner = frm_BG1
'TODO: This line of code loads data into the 'U_PDataSet.Usernames_Passwords' table. You can move, or remove it, as needed.
Me.Username_PasswordTableAdapter.Fill(Me.Username_PasswordDataSet.Username_Password)
IDTextBox.Enabled = False
UserTypeTextBox.Enabled = False
UsernameTextBox.Enabled = False
PasswordTextBox.Enabled = False
End Sub
Private Sub KryptonButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KryptonButton3.Click
Me.Username_PasswordBindingSource.AddNew()
IDTextBox.Enabled = True
UserTypeTextBox.Enabled = True
UsernameTextBox.Enabled = True
PasswordTextBox.Enabled = True
End Sub
Private Sub KryptonButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KryptonButton4.Click
Me.Validate()
Me.Username_PasswordBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Username_PasswordDataSet)
End Sub
Private Sub KryptonButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KryptonButton5.Click
Me.Username_PasswordBindingSource.RemoveCurrent()
End Sub
End Class