[size=2][color=#0000ff]
[size=2][color=#0000ff]Private[/color][/size][size=2][color=#000000] reader [/color][/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#000000] OleDbDataReader[/color][/size]
Function[/color][/size][size=2] Search()
[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] cmd [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]New[/color][/size][size=2] OleDbCommand
[/size][size=2][color=#0000ff]Try
[/color][/size][size=2][color=#0000ff]Me[/color][/size][size=2].OleDbConnection1.ConnectionString = connString
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].OleDbConnection1.Open()
cmd.Connection = OleDbConnection1
cmd.Parameters.Add("@Enrolmentnumber", [/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBox1.Text)
cmd.CommandType = CommandType.Text
cmd.CommandText = "select * from student where (Enrolmentnumber = @Enrolmentnumber)"
reader = cmd.ExecuteReader
reader.Read()
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBoxSal.Text = reader.Item("Salutation")
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBoxCounty.Text = reader.Item("County")
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBoxForename.Text = reader.Item("Forename")
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBoxHousenumber.Text = reader.Item("Housenumber")
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBoxPostCode.Text = reader.Item("Postcode")
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBoxStreet.Text = reader.Item("Street")
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBoxSurname.Text = reader.Item("Surname")
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBoxTelephoneNo.Text = reader.Item("TelephoneNumber")
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBoxTownCity.Text = reader.Item("TownCity")
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBoxLocation.Text = reader.Item("Location")
[/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBoxjobType.Text = reader.Item("Jobtype")
[/size][size=2][color=#0000ff]Dim[/color][/size][size=2] i [/size][size=2][color=#0000ff]As[/color][/size][size=2][color=#0000ff]String
[/color][/size][size=2]i = reader.Item("Placed")
[/size][size=2][color=#0000ff]If[/color][/size][size=2] i = [/size][size=2][color=#0000ff]True[/color][/size][size=2][color=#0000ff]Then
[/color][/size][size=2][color=#0000ff]Me[/color][/size][size=2].CheckBoxPlaced.Checked = [/size][size=2][color=#0000ff]True
[/color][/size][size=2][color=#0000ff]Else
[/color][/size][size=2][color=#0000ff]Me[/color][/size][size=2].CheckBoxPlaced.Checked = [/size][size=2][color=#0000ff]False
[/color][/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]If
[/color][/size][size=2][color=#0000ff]Catch[/color][/size][size=2] ex [/size][size=2][color=#0000ff]As[/color][/size][size=2] Exception
NotificationWindow1.Notify(ex.ToString, 5000)
[/size][size=2][color=#0000ff]Finally
[/color][/size][size=2][color=#0000ff]Me[/color][/size][size=2].OleDbConnection1.Close()
[/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Try
[/color][/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Function[/color][/size]
[size=2][color=#0000ff]Private[/color][/size][size=2][color=#0000ff]Sub[/color][/size][size=2] UtilityToolBar1_ForwardPressed([/size][size=2][color=#0000ff]ByVal[/color][/size][size=2] sender [/size][size=2][color=#0000ff]As[/color][/size][size=2] System.Object, [/size][size=2][color=#0000ff]ByVal[/color][/size][size=2] e [/size][size=2][color=#0000ff]As[/color][/size][size=2] System.EventArgs) [/size][size=2][color=#0000ff]Handles[/color][/size][size=2] UtilityToolBar1.ForwardPressed
[/size][size=2][color=#0000ff]If[/color][/size][size=2] reader.Read() [/size][size=2][color=#0000ff]Then
[/color][/size][size=2][color=#0000ff]Me[/color][/size][size=2].TextBoxForename.Text = reader("Forename")'This doesn't work
[/size][size=2][color=#0000ff]Else
[/color][/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]If
[/color][/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Sub
[/color][/size][size=2][color=#0000ff]