emaduddeen
Programmer
Hi Everyone,
I'm experimenting with manually navigating through a DataSet created by the wizard.
Please check my navigation code. I can navigate ok through the DataSet but the data on the form is not refreshing. Can you tell me how to refresh it?
I already tried to use: Me.Refresh() but I can see this is not the correct code to use.
Here's the code:
Thanks.
Truly,
Emad
I'm experimenting with manually navigating through a DataSet created by the wizard.
Please check my navigation code. I can navigate ok through the DataSet but the data on the form is not refreshing. Can you tell me how to refresh it?
I already tried to use: Me.Refresh() but I can see this is not the correct code to use.
Here's the code:
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' This line of code loads data into the 'NoveltyDataSet.tblCustomer' table.
' You can move, or remove it, as needed.
'--------------------------------------------------------------------------
Me.TblCustomerTableAdapter.Fill(Me.NoveltyDataSet.tblCustomer)
End Sub
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
' Navigate forward 1 position in the DataSet.
'--------------------------------------------
Me.BindingContext(NoveltyDataSet, "tblCustomer").Position += 1
Me.Refresh()
With Me.BindingContext(NoveltyDataSet, "tblCustomer")
lblDataStatus.Text = "Record " & .Position + 1 & " of " & .Count
End With
End Sub
Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
' Navigate forward 1 position in the DataSet.
'--------------------------------------------
Me.BindingContext(NoveltyDataSet, "tblCustomer").Position -= 1
Me.Refresh()
With Me.BindingContext(NoveltyDataSet, "tblCustomer")
lblDataStatus.Text = "Record " & .Position + 1 & " of " & .Count
End With
End Sub
Thanks.
Truly,
Emad