Link to home
Start Free TrialLog in
Avatar of Tom Powers
Tom Powers

asked on

quaduplites records in datagridview from a 3 join sql query

Hey I wrote a query where I join 3 tables I'm getting same player 4 times I have no Idea why. here is sql queies
 sql = "SELECT np.FirstName, np.LastName, np.Position,Teams.Fullname, np.College,np.Status,np.Jersey, np.Height,"
        sql += " np.Weight, np.Born, np.BioHtml, np.HighSchool,np.TeamID, np.PlayerID, np.NCAAID, Draft.draftyear, Draft.round,Draft.DraftPos, Draft.OverallPos, Draft.DraftTeamID, Draft.OrigTeamID"
        sql += " FROM NFLPlayers np Join Teams ON Teams.TeamID = np.TeamID Join Draft ON Draft.PlayerID = np.NCAAID WHERE"
        sql += " Status ='A' AND Position<> ''"
       

        connection = New SqlConnection(connetionString)

        Try
            connection.Open()
            adapter = New SqlDataAdapter(sql, connection)
            adapter.Fill(ds)
            connection.Close()
            DataGridView1.DataSource = ds.Tables(0)

Open in new window


here is what is outputted
User generated image
What am I doing wrong? EE Please help
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tom Powers
Tom Powers

ASKER

I've requested that this question be deleted for the following reason:

I figured out that I didn't need to use 3 join query.
Please spell out in greater detail how this was 'figured out', so we can accept that answer so others may benefit.
Cancelling delete request.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial