i created a form with 4 textbox tht user can insert their data and stored it in sql server 2000 databse..than i manage to display the data when user starting the program... i also create an update button for user to update their data...
the problem is when i want to move to the next data nothing appear...the same when i want to look for previous data... i really seek help here hope anyone outhere can solve my problem... thakz and appreciate alot
"this the code for button next n previous"
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
varConnection = New SqlConnection("Server=(local);user id=sa;password=;Initial Catalog=ROP1")
Try
varConnection.Open()
varAdapter.Fill(varDataSet, "tbl_rop")
Dim rowRop1 As System.Data.DataRow
Catch ex As Exception
End Try
sql = "SELECT * FROM tbl_rop"
sql = "SELECT distinct * FROM tbl_rop"
'Dim con As String = ConfigurationSettings.AppSettings("preeconn")
varCommand = New SqlCommand(varQuery, varConnection)
varCommand = New SqlCommand(sql, varConnection)
varAdapter = New SqlDataAdapter(varCommand)
'Dim maxrws As String
Dim i As Integer
varAdapter.Fill(varDataSet)
'sql = varAdapter.Fill(varDataSet)Rows.Count.
'varAdapter.Fill(varDataSet) 'used to get the count of number of rows in a table
i = 0
For i = 0 To -1
TextBox1.Text = varDataSet.Tables("tbl_rop").Rows(0).Item("Name_User")
TextBox2.Text = varDataSet.Tables("tbl_rop").Rows(0).Item("Date_of_birth")
TextBox3.Text = varDataSet.Tables("tbl_rop").Rows(0).Item("Hobbies")
TextBox4.Text = varDataSet.Tables("tbl_rop").Rows(0).Item("Phone_number")
Next i
TextBox1.Text = varDataSet.Tables("tbl_rop").Rows(0).Item("Name_user")
TextBox2.Text = varDataSet.Tables("tbl_rop").Rows(0).Item("Date_of_birth")
TextBox3.Text = varDataSet.Tables("tbl_rop").Rows(0).Item("Hobbies")
TextBox4.Text = varDataSet.Tables("tbl_rop").Rows(0).Item("Phone_number")