Content of sql table is not displayed in LookUpEdit Visual Studio

0

I have a LookUpEdit in which I want to show the contents of a SQL table. The code I have for it is:

 Sub mostrarLookUp()
    Try
        con.Open()
        Dim cmd As New SqlDataAdapter("select IDCON, Concepto from Concepto", con)
        cmd.Fill(tbl)
        con.Close()

       LookUpEdit1.Properties.DataSource = tbl
       LookUpEdit1.Properties.DisplayMember = "Concepto"
       LookUpEdit1.Properties.ValueMember = "IDCON"

    Catch ex As Exception
        MsgBox(ex.Message)
    End Try

End Sub

I called the data source called tbl manually in the properties of the LookUpEdit.

The function I am sending it to call in the form where the LookUp is located, in the load event, however it does not show me information. It does not mark any syntax error, it just does not show anything.

I have a Module in the development where 'with' contains the connection string to the database, that's why I start the function in con.Open ().

Any suggestions on what I still need to do?

    
asked by Jonsin 05.06.2018 в 00:46
source

0 answers