duplicate results retrieved on web page but only 1 DB record?

Discussion in 'ASP.NET / ASP.NET Core' started by zoey, Oct 22, 2008.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello,

    My website contains a page that retrieves user profile data from several tables in the DB and displays the results in a grid. For some unknown reason, certain users are returned twice in the web page output, however, only one underlying record exists in the database. When I run the query directly against the database, the correct (expected) results are returned; i.e., only one result per user in the output.

    Can anyone advise what could be causing this duplicated result to show up in the web page?

    I have pulled out most of my hair trying to figure it out! Note: I beleive that using DISTINCT in the SQL shouldn't matter, bc there is only one record to begin with. Also, the bug appears to be random - with over 10k users, it only surfacesa few times so far - so I can't nail down a pattern.

    My only "solution" has been to delete the user from the DB tables, and then recreate the user's profile from the front end webpages. But this is time consuming, and I'd rather fix the problem directly.

    Thanks in advance!
     
  2. Just to close this out...

    I found that one of the tables in the join had duplicated records. I deleted the appropriate records from that table and fixed the issue.

    I missed it at first because I was only looking at the main user table, but the issue was in another table.

    I fixed the issue about a week after posting, but just now got around to posting back...[​IMG]

    Thanks
     
  3. Bruce

    Bruce DiscountASP.NET Staff

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page