tags:

views:

131

answers:

1

I have a table called "X". I am trying to update this table by clicking "update button" in a datagrid. When I do that I am getting with the below error.

Item has already been added. Key in dictionary: 'admin' Key being added: 'admin'

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Item has already been added. Key in dictionary: 'admin' Key being added: 'admin'

A: 

Sorry to be blunt, but it simply seems like you are using a Dictionary, Hashtable or SortedList and are trying to add an item to that list who's key (in this case "admin")already exists in that list.

You can

1) Check to see if the item already exists in the list and not add it 2) Maybe you are running a piece of code more times than you think for some reason.

I agree that a code sample would be very benificial in better answering that question.

Mark