Option Strict Off Imports System Imports System.Data Imports System.Data.SqlTypes Imports System.Data.SqlClient Imports System.Windows.Forms Imports System.Drawing Public Class YouthJob Private dtApplicants As DataTable Private cmApplicants As CurrencyManager Private dtJobs As DataTable Private dvjobs As New DataView Private WithEvents cmJobs As CurrencyManager Private Sub ApplicantsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ApplicantsBindingNavigatorSaveItem.Click Me.Validate() Me.ApplicantsBindingSource.EndEdit() Me.ApplicantsTableAdapter.Update(Me.SYEP2007DataSet.Applicants) End Sub Private Sub YouthJob_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'TODO: This line of code loads data into the 'SYEP2007DataSet.JobTitles' table. You can move, or remove it, as needed. 'Me.JobTitlesTableAdapter.Fill(Me.SYEP2007DataSet.JobTitles) 'Me.ApplicantsTableAdapter.Fill(Me.SYEP2007DataSet.Applicants) Try Me.JobTitlesTableAdapter.Fill(Me.SYEP2007DataSet.JobTitles) Catch ex As Exception MessageBox.Show(ex.StackTrace) End Try Try Me.ApplicantsTableAdapter.Fill(Me.SYEP2007DataSet.Applicants) Catch ex As Exception MessageBox.Show(ex.StackTrace) End Try dtApplicants = Me.SYEP2007DataSet.Applicants dtJobs = Me.SYEP2007DataSet.JobTitles 'filltables() 'equivalent to filling tables with ... '... a dataadapter or a tableadapter 'get and display the count of applicant records 'Dim count As Integer = dtApplicants.Rows.Count 'So I can filter the count I added a Stored Procedure and us it instead _ ' of dtApplicants.Rows.Count. Dim count As Integer = CType(Me.ApplicantsTableAdapter.spCount_Applicants2008Total, Integer) txtTotalApplicants.Text = String.Format("{0} Applicants", count) 'bind the applicants table to the datagridview ApplicantsDataGridView.DataSource = dtApplicants 'set up the currencymanager - convenient for referring ... '... to the currently selected row in the applicants grid cmApplicants = CType(BindingContext(dtApplicants), CurrencyManager) 'set up a dataview to filter the jobs table so it ... '... only shows those where some jobs remain available dvjobs.Table = dtJobs 'dvjobs.RowFilter = "txtWorksiteJobTitlePositionsNumber > 0" '<<<<