is it solved ? or you still have problem :S
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Dim varConnection As New SqlConnection
Dim varDataSet As New DataSet
Dim varAdapter As SqlDataAdapter
Dim varCommand As SqlCommand
Dim varchar As SqlDataAdapter
Dim sql As String
Dim Record_num = 0 ' you do not need this here
Dim Number_of_Rows As Integer = 0 'why zero? this will hold number of rows in your table so you will be sure that once you reached last record you will not increment it
varConnection = New SqlConnection("Server=(local);user id=sa;password=;Initial Catalog=ROP1")
sql = "SELECT * FROM tbl_rop"sql = "SELECT distinct * FROM tbl_rop"
varCommand = New SqlCommand(varQuery, varConnection)
varCommand = New SqlCommand(sql, varConnection)
varAdapter = New SqlDataAdapter(varCommand)varAdapter.Fill(varDataSet) 'used to get the count of number of rows in a table
Number_of_Rows=varDataSet .Tables("your_table_name").Rows.Count
If Record_num <> Number_of_Rows - 1 Then
Record_num = +1
TextBox1.Text = varDataSet.Tables(0).Rows(Record_num).Item("Name_User")
TextBox2.Text = varDataSet.Tables(0).Rows(Record_num).Item("Date_of_birth")
TextBox3.Text = varDataSet.Tables(0).Rows(Record_num).Item("Hobbies")
TextBox4.Text = varDataSet.Tables(0).Rows(Record_num).Item("Phone_number")
End If