Computing Staff
  • 1

Move To Next Record Each Time In Vb.Net

  • 1

Dim i As Integer
Dim con As New SqlConnection(“Data Source=QADCOM7026;Initial Catalog=stu_info1;Integrated Security=True”)
con.Open()
Dim adp As New SqlDataAdapter(“select * from stu_info”, con)
Dim builder As New SqlCommandBuilder(adp)
Dim ds As New DataSet()
adp.Fill(ds, “stu_info”)

If (i < ds.Tables(0).Rows.Count – 1) Then
i = i + 1

textBox1.Text = ds.Tables(0).Rows(i)(“First_name”).ToString()
textBox2.Text = ds.Tables(0).Rows(i)(“Last_name”).ToString()
textBox3.Text = ds.Tables(0).Rows(i)(“Address”).ToString()
textBox4.Text = ds.Tables(0).Rows(i)(“Phone_no”).ToString()
textBox5.Text = ds.Tables(0).Rows(i)(“City”).ToString()
Else
MessageBox.Show(“this is first record”)

End If

this is my coding in vb.net,i want to move next record each time but it shows only one next record,kindly provide me help plz

Share