Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8712733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:10:13+00:00 2026-06-13T05:10:13+00:00

I have a query that executes perfectly in Postgresql: SELECT matchid , f1.firstname ,

  • 0

I have a query that executes perfectly in Postgresql:

SELECT 
      matchid
    , f1.firstname
    , f1.lastname
    , f2.firstname
    , f2.lastname
FROM matches AS m
    INNER JOIN fighters AS f1
        ON f1.fighterid = m.fighteroneid
    INNER JOIN fighters AS f2
        ON f2.fighterid = m.fightertwoid

It displays one row with the fighters, but when I attempt to display the results in a combo box it displays as “System.Data.DataRow” as opposed to the data.

Code in VB.NET:

mySelectQuery = "SELECT f1.firstname, f1.lastname, f2.firstname, f2.lastname FROM matches AS m INNER JOIN fighters AS f1 ON f1.fighterid = m.fighteroneid INNER JOIN fighters AS f2 ON f2.fighterid = m.fightertwoid"

pgAdapter = New PgSqlDataAdapter(mySelectQuery, pgConnection)
    pgAdapter.Fill(dtMatches)

    With cboMatches
        .DisplayMember = "fighters"
        .ValueMember = "matchid"
        .DataSource = dtMatches
        .SelectedIndex = -1
    End With

I have attempted to use fighters, m, f1, f2 as display member and it always returns the same output.

If I move the .DataSource above .DisplayMember I recieve the error: Cannot bind to the new display member. Parameter name: newDisplayMember.

Thank you in advance,

Spence

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:10:14+00:00Added an answer on June 13, 2026 at 5:10 am

    ValueMember and DisplayMember should refer to column names of your datasource.
    You don’t have anything with the names assigned.
    You could try to assign one name to the DisplayMember, but your query doesn’t produce any MatchID.

    I am not an expert in PostegreSQL, but, you could try the following to aggregate the names

    mySelectQuery = "SELECT m.MatchID, string_agg(f1.firstname, f1.lastname, ' - ', " + 
                    "f2.firstname, f2.lastname, ' ') as Fighters " + 
                    "FROM matches AS m INNER JOIN fighters AS f1 ON f1.fighterid = m.fighteroneid" +
                    " INNER JOIN fighters AS f2 ON f2.fighterid = m.fightertwoid"
    

    and then use

    With cboMatches  
        .DisplayMember = "Fighters"  
        .ValueMember = "MatchID"  
        .DataSource = dtMatches  
        .SelectedIndex = -1  
    End With  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following query that executes perfectly in MySQL, but it is giving
I have an application that executes the following MySQL query: SELECT 402 AS user_id,
I have an SQL query that executes a LEFT JOIN on another table, then
I have defined a function in my Navigation model that executes a query, and
I have made a form that accepts query and executes it through php. I
I have have this query that i want to execute. SELECT warehouse.expiry_date, pharmacy.expiry_date, drugs.active_substance,
I have a query that successfully grabs the unique products from my products table
I have following query select * from table1 if table1 contains text type column/columns
I have a linq query that executes successfully, one of the columns returned is
I have a native query that executes a stored procedure and the results is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.