[2005] Help Using Tool Strip Control
I'm a little confused and could use some help. I'm doing a project for class and there is a part somewhat confusing. I have a table (tblCourses) with Id#, title, credit hours, and grades. The interface has several tool strip bars with queries to run if you press a particular tool strip. The code asks me to write some sort of statement but the book tells me if I just add a tool strip control associated with the query it should display when the app runs and I press the tool strip. It is pretty confusing and maybe someone knows what type of statement would be appropriate in this case. Here is the code I have:
VB Code:
Public Class MainForm
Private Sub bindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bindingNavigatorSaveItem.Click
If Me.Validate Then
'I wrote this part
Me.TblCoursesBindingSource.EndEdit()
Me.TblCoursesTableAdapter.Update(Me.CoursesDataSet.tblCourses)
Else
System.Windows.Forms.MessageBox.Show(Me, "Validation errors occurred.", "Save", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning)
End If
End Sub
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load, MyBase.Load, MyBase.Load, MyBase.Load, MyBase.Load, MyBase.Load, MyBase.Load
'TODO: This line of code loads data into the 'CoursesDataSet.tblCourses' table. You can move, or remove it, as needed.
'I wrote this part
Me.TblCoursesTableAdapter.Fill(Me.CoursesDataSet.tblCourses)
End Sub
Private Sub exitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton.Click
Me.Close()
End Sub
Private Sub FillToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FillToolStripButton.Click
Try
'I'm confused about this part
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End Sub
End Class
As always, all help in understanding is very much appreciated.