Hey all,

I'm trying to show some concatenated data in a CheckedListBox so that users are able to select the data for use later on. Here is the code I am using currently:

Dim con As New MySqlConnection
        Dim theQuery As New MySqlCommand
        Dim theTables As New DataTable
        Dim theAdapter As New MySqlDataAdapter
        Dim strColumns As String

        strColumns = "SELECT CONCAT( Table_Name, '.', Column_Name ) FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'm_fyp2011_n0218430'"


        CreateRow()

        con.ConnectionString = frmLogin.strconn

        con.Open()
        theQuery.Connection = con
        theQuery.CommandText = strColumns
        theAdapter.SelectCommand = theQuery
        theAdapter.Fill(theTables)

        clbFields.BeginUpdate()
        clbFields.DataSource = theTables
        clbFields.DisplayMember = "CONCAT(Table_Name, '.', Column_Name)"
        clbFields.EndUpdate()

        con.Close()

However, this just comes up with "System.Data.DataRowView". How can I get it to display the actual results?

Thanks in advance :)

Can I suggest you give it an alias

SELECT CONCAT( Table_Name, '.', Column_Name ) AS TableCol FROM

then use TableCol in your code.

So simple!! Can't believe I didn't think of doing this. Thank you so much :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.