Hi, My code is:

sqlsub = "SELECT  distinct field1, field2"
        sqlsub += " FROM tbl I
        Dim da As OleDbDataAdapter
        Dim lsdataset As New DataSet
        'populate data adapter
        da = New OleDbDataAdapter(sqlsub, conn)
        da.Fill(lsdataset, "tbl")
        thpr = Gettheoprac(lsdataset.Tables(0).Rows(0).Item(1).ToString, "shortform")
        subcombo.DataSource = lsdataset.Tables("tblname").DefaultView
        subcombo.DisplayMember = "snshort" + "(" + thpr + ")"
        subcombo.ValueMember = "snshort"

My prob is how should I bind the combo with field1+"("+ thpr+ ")"
thpr is the string i get from function by passing field value 2 from query

my combobox should be displayed as field1 + (thpr).

Please Help

Thanks

DisplayMember and ValueMember properties must uses name of Fields/columns.

subcombo.DisplayMember ="field1"
subcombo.ValueMember="field2"
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.