Dim cnn As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=E:\University\2nd year - resit\Multimedia\assaingment2\northwind.mdb")
Dim strSQL As String
strSQL = "SELECT * FROM Employees Where Lastname LIKE'" & TextBox1.Text & "%'"
Dim cmd As OleDbCommand = New OleDbCommand(strSQL, cnn)
cnn.Open()
'build the dataReader
Dim reader As OleDbDataReader = cmd.ExecuteReader
'read the first row
If reader.Read() Then
'set the textBoxs with appropriate data
TextBox1.text = reader.GetString(1)
Me.TextBoxFirstName.Text = reader.GetString(2)
Me.TextBoxPosition.Text = reader.GetString(3)
TextBoxCurtsey.text = reader.GetString(4)
TextBoxBirth.text = reader.GetValue(5)
reader.Close()
cnn.Close()