Hello there!
i have a textbox with autocomplete mode suggested e autocompletesource customsource.
With Keypress event, i fill the customsource dinamically.
Randomly it happens that it thrown this exception (below the code)
can you help me?
i have a textbox with autocomplete mode suggested e autocompletesource customsource.
With Keypress event, i fill the customsource dinamically.
Randomly it happens that it thrown this exception (below the code)
can you help me?
chie.AutoCompleteSource = Windows.Forms.AutoCompleteSource.None chie.AutoCompleteCustomSource.Clear() Dim Database As New SQL.SQL Database.Login() Dim datatable As New DataTable Dim query As String = "" Select Case chie.Name Case "aggiungi_fumetti_testata" 'MsgBox("testata") query = "SELECT TOP 20 titolo FROM Testate where titolo LIKE '" & chie.Text.Replace("'", "''") & "%' AND id > 0" End Select If chie.Name Like "aggiungi_fumetti_nomeautore#" Then 'MsgBox("autore") query = "SELECT top 20 nome from autori WHERE nome like '" & chie.Text.Replace("'", "''") & "%' AND id > 0" End If datatable = Database.RiempiDataGrid(query) chie.AutoCompleteCustomSource.Clear() Dim r As DataRow For Each r In datatable.Rows chie.AutoCompleteCustomSource.Add(r.Item(0).ToString) Next chie.AutoCompleteSource = Windows.Forms.AutoCompleteSource.CustomSource