Public Sub autocompletar(ByVal campotexto As TextBox)
Try
cn.Open()
cmd = New SqlCommand("select nombre_profesor, apellido_profesor from profesor ", cn)
rd = cmd.ExecuteReader()
While rd.Read
campotexto.AutoCompleteCustomSource.Add(rd.Item("nombre_profesor") & (" ") & rd.Item("apellido_profesor"))
End While
cn.Close()
Catch ex As Exception
MsgBox("No hubo conección", MsgBoxResult.No)
End Try
End Sub