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'"


        con.ConnectionString = frmLogin.strconn

        theQuery.Connection = con
        theQuery.CommandText = strColumns
        theAdapter.SelectCommand = theQuery

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


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

Thanks in advance :)

Recommended Answers

All 2 Replies

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, learning, and sharing knowledge.