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

  • Home
  • SEARCH
  • 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 7022357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:34:17+00:00 2026-05-27T23:34:17+00:00

I know the error is a common one but i’m not sure how to

  • 0

I know the error is a common one but i’m not sure how to solve this.

my scenario is this:

  • click button on window 1, window 2 will show (populates text boxes).
  • finish transaction on window 2 (save data).
  • click BACK button on window 2 (closes window 2, opens window 1).
  • again, click button on window 1 to open and populate data on window 2.
  • error fires. An item with the same key has been added.
  • 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-05-27T23:34:18+00:00Added an answer on May 27, 2026 at 11:34 pm

    It sounds like you are adding data to something in Window 2 that is shared across the entire application, or all instance of Window 2. When you enter Window 2 for a second time and populate your data, you are likely adding the data into a Dictionary that has already been added. Hence the message “An item with the same key has already been added”.

    My advice: put a break point in the code where you populate the data, and check the values contained within the Dictionary (if you have used one and have access to it). Then check the data you are adding and you should find the replication.

    Alternately, there are various ways to prevent duplicate entries being added.

    1. Clean the Dictionary when you have finished with it the first time – this way you only add the data in once (unless you have duplicate entries in your source data).

    2. See if the key exists within the Dictionary before adding the entry. You can do this by using if (mSomeDictionary.ContainsKey(someEntryKey))/

    3. If you simply want to use the latest values, you can just override the data keyed with a certain object. You can do this by using something like: mSomeDictionary[someEntryKey] = someValue;. If the entry key doesn’t already exist, a new entry will automatically be added.

    If none of the above helps you at all, post the code where the error occurs and include the Stack Trace from within the thrown exception and we can look into it further.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is a common error, but bear with me. I've pursued the
I know this seems to be a common one, but I'm lost with it.
I know one can add event listener for window.error. However when working with Iframes,
Does anyone know what error message will be displayed when someone tries to run
Anyone know what this error means? after googling I found a bunch of sites
I know what this error is, how to fix it, etc. My question is
Does anyone know what this error message means? FATAL: Code generation error detected during
I dont know where my error is in this mysql query $sql = INSERT
How can I do something like this but avoid the error column common_reference is
I know this sounds backwards but I am looking for a way to search

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.