Sei sulla pagina 1di 1

Public Class Form1

Private Sub Student_DetailsBindingNavigatorSaveItem_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
Student_DetailsBindingNavigatorSaveItem.Click
Me.Validate()
Me.Student_DetailsBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Student_SystemDataSet)

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
'TODO: This line of code loads data into the
'Student_SystemDataSet.Student_Details' table. You can move, or remove it, as needed.
Me.Student_DetailsTableAdapter.Fill(Me.Student_SystemDataSet.Student_Details)

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button1.Click
Me.Student_DetailsBindingSource.AddNew()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button2.Click
Try
Me.Student_DetailsBindingSource.EndEdit()
Me.Student_DetailsTableAdapter.Update(Student_SystemDataSet.Student_Details)
MessageBox.Show("success")
Catch ex As Exception
MessageBox.Show("failed")
End Try
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button3.Click
Me.Student_DetailsBindingSource.RemoveCurrent()
End Sub
End Class

Potrebbero piacerti anche