Hi, i tried using your method - couldn't get it to work
I have tried this and it also doent work as it says object reference not instance of object on the top line:-
I am filling the dataset using this:-
And navigating through the records like this:- (which doesnt work)
Anyone see the error in my ways?....
Alex
I have tried this and it also doent work as it says object reference not instance of object on the top line:-
VB.NET:
Private Sub NavigateRecords()
txtUsername.Text = ds.Tables("Users").Rows(inc).Item("LoginName")
txtPassword.Text = ds.Tables("Users").Rows(inc).Item(2)
txtFullName = ds.Tables("Users").Rows(inc).Item(3)
End Sub
I am filling the dataset using this:-
VB.NET:
Private Sub frmUserData_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ds As New DataSet("Users")
Dim strSQL As String
Dim conn As OleDbConnection = carDba.getCn
strSQL = "SELECT UserId, LoginName, LoginPassword, userLevelId, fullName " & _
"FROM tblUser"
Dim da As New OleDbDataAdapter(strSQL, conn)
da.Fill(ds, "Users")
'txtUsername.Text = ds.Tables("UserId").Rows(0).Item(2)
MaxRows = ds.Tables("Users").Rows.Count
inc = -1
End Sub
And navigating through the records like this:- (which doesnt work)
VB.NET:
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
If inc <> MaxRows - 1 Then
inc = inc + 1
NavigateRecords()
Else
MsgBox("No More Rows")
End If
End Sub
Anyone see the error in my ways?....
Alex