i use the below code for the next button, but it wont work.iszit because my coding is all wrong?
below is my coding:
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Documents and Settings\YangLim\My Documents\Assignment2.mdb"
Dim MyConn As New OleDbConnection(strConn)
Dim MySQL As String
MySQL = "SELECT CustomerID,CustomerName,CustomerAddress,CustomerPostCode,CustomerGender,CustomerContactNo,CustomerDOB,CustomerNRIC FROM Customer "
Dim cmd As New OleDbCommand(MySQL, MyConn)
MyConn.Open()
Dim reader As OleDbDataReader
reader = cmd.ExecuteReader
'read the first row
If reader.Read() Then
'set the textBoxs with appropriate data
txtCustID.Text = reader("CustomerID")
txtName.Text = reader("CustomerName")
txtAddress.Text = reader("CustomerAddress")
txtPostcode.Text = reader("CustomerPostCode")
cboGender.Text = reader("CustomerGender")
txtContactNo.Text = reader("CustomerContactNo")
txtDOB.Text = reader("CustomerDOB")
txtIC.Text = reader("CustomerNRIC")
Else
txtCustID.Text = ""
txtName.Text = ""
txtAddress.Text = ""
txtPostcode.Text = ""
cboGender.Text = ""
txtContactNo.Text = ""
txtDOB.Text = ""
txtIC.Text = "End Of file"
End If
reader.Close()
MyConn.Close()
End Sub