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
here is what is outputted
What am I doing wrong? EE Please help
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)
here is what is outputted
What am I doing wrong? EE Please help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please spell out in greater detail how this was 'figured out', so we can accept that answer so others may benefit.
Cancelling delete request.
Cancelling delete request.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I figured out that I didn't need to use 3 join query.