Question : Next and Previous Buttons not working

I added First, Previous, Next and Last buttons to my windows form so the user could cycle through the records in a dataset.  But the form fields are not updating when the buttons are selected.  I'm missing something.  Can someone please help me?  Thank you.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
Private Sub lstPtName_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstPtName.Click
        LoadPtData()
        Me.txtNoRecs.Text = Me.BindingContext(dsPatient.Tables("Patients")).Count.ToString
        Me.BindingContext(dsPatient.Tables("Patients")).Position = 0
        Me.txtCurRec.Text = Me.BindingContext(dsPatient.Tables("Patients")).Position + 1
    End Sub

    Private Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click
        If Me.BindingContext(dsPatient.Tables("Patients")).Position < Me.BindingContext(dsPatient.Tables("Patients")).Count - 1 Then
            Me.BindingContext(dsPatient.Tables("Patients")).Position = Me.BindingContext(dsPatient.Tables("Patients")).Position + 1
            Me.txtCurRec.Text = Me.BindingContext(dsPatient.Tables("Patients")).Position + 1
        End If
    End Sub

    Private Sub btnLast_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLast.Click
        Me.BindingContext(dsPatient.Tables("Patients")).Position = Me.BindingContext(dsPatient.Tables("Patients")).Count - 1
        Me.txtCurRec.Text = Me.BindingContext(dsPatient.Tables("Patients")).Position + 1
    End Sub

    Private Sub btnPrev_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrev.Click
        If Me.BindingContext(dsPatient.Tables("Patients")).Position > 0 Then
            Me.BindingContext(dsPatient.Tables("Patients")).Position = Me.BindingContext(dsPatient.Tables("Patients")).Position - 1
            Me.txtCurRec.Text = Me.BindingContext(dsPatient.Tables("Patients")).Position + 1
        End If
    End Sub

    Private Sub btnFirst_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFirst.Click
        Me.BindingContext(dsPatient.Tables("Patients")).Position = 0
        Me.txtCurRec.Text = Me.BindingContext(dsPatient.Tables("Patients")).Position + 1
    End Sub
    Sub LoadPtData()

        dsPatient.Clear()
        Dim daPatient As New SqlClient.SqlDataAdapter("SELECT * FROM RawData WHERE PtName = '" & lstPtName.Text & "'", conn)

        Try
            conn.Open()
            dapatient.Fill(dsPatient, "Patients")
            conn.Close()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

        If txtPtName.DataBindings.Count = 0 Then
            txtPtName.DataBindings.Add("Text", dsPatient, "Patients.PtName")
            txtDOB.DataBindings.Add("Text", dsPatient, "Patients.PtDOB", True, DataSourceUpdateMode.OnPropertyChanged, Nothing, "MMM dd, yyyy")
            txtSex.DataBindings.Add("Text", dsPatient, "Patients.PtSex")
            txtPhys.DataBindings.Add("text", dsPatient, "Patients.PhyName")
            txtTest.DataBindings.Add("Text", dsPatient, "Patients.Test")
            txtResult.DataBindings.Add("Text", dsPatient, "Patients.Result")
            txtUOM.DataBindings.Add("Text", dsPatient, "Patients.UOM")
            txtCollDate.DataBindings.Add("Text", dsPatient, "Patients.CollectDate", True, DataSourceUpdateMode.OnPropertyChanged, Nothing, "MMM dd, yyyy")
            txtCollTime.DataBindings.Add("Text", dsPatient, "Patients.CollectTime")
        End If
    End Sub

Answer : Next and Previous Buttons not working

File sharing Group Policy settings
Group Policy settings associated with file sharing
Group Policy setting       Purpose

Prevent users from sharing files within their profile
      

Determines whether users are allowed to share files within their profile to other users on their network. Sharing of any kind is enabled only when an administrator has turned on file sharing on that computer.

If you enable this policy, users will not be able to share files within their profile using the sharing wizard. Also, the sharing wizard will not create a share at %SystemRoot%\users and can only be used to create SMB shares on folders.

If you disable or do not configure this policy, then users will be able to share files out of their user profile after an administrator has turned on file sharing on that computer.



Source: http://technet.microsoft.com/es-es/library/cc731655%28WS.10%29.aspx
Random Solutions  
 
programming4us programming4us