Sub Autocompletar() Dim Cmd As MySqlCommand Dim Reader As MySqlDataReader = Nothing Dim AutoComp As New AutoCompleteStringCollection Try Cmd = New MySqlCommand Cmd.Connection = Conexion Cmd.CommandText = "SELECT * from articulos where cantidad>0" Reader = Cmd.ExecuteReader() If Reader.HasRows Then While (Reader.Read()) AutoComp.Add(Reader.GetString("nombre")) End While End If Catch ex As Exception MsgBox(ex.Message) End Try With TextBox1 .AutoCompleteMode = AutoCompleteMode.Suggest .AutoCompleteSource = AutoCompleteSource.CustomSource .AutoCompleteCustomSource = AutoComp .Clear() .Focus() End With Reader.Close() End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)