Error When adding a new operator with Acess DB

  •  03-05-2008, 9:51 AM

    Error When adding a new operator with Acess DB

    When I use Access DB I get an error adding a third operator.
    Or if I try to aassign an operator to a department I get the following error:
     
     

    Server Error in '/fastchat/steiner' Application.

    The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship.  Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.

    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.Data.OleDb.OleDbException: The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship.  Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.

    Source Error:

    Line 231:
                Line 232:		string deptname=(string)ManageLiveSupport.DataGrid2.DataKeys[Item.ItemIndex];
                Line 233:		CuteChat.ChatWebUtility.AddAgent(deptname,CuteChat.ChatProvider.Instance.ToUserId(name));
                Line 234:
                Line 235:		DataGrid3.DataBind();

    Source File: d:\hosting\inetguys\fastchat\steiner\ManageDepartments.aspx    Line: 233

    Stack Trace:

    [OleDbException (0x80004005): The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship.  Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.]
                System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +267
                System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +192
                System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +48
                System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +106
                System.Data.OleDb.OleDbCommand.ExecuteNonQuery() +108
                CuteChat.MSAccessDataProvider.AddAgent(Int32 departmentid, String userid) +166
                CuteChat.ChatDataManager.AddAgent(Int32 departmentid, String userid) +238
                CuteChat.ChatDataManager.AddAgent(String department, String userid) +127
                CuteChat.ChatWebUtility.AddAgent(String depname, String agentid) +135
                ASP.DataGrid2ItemScope.AddAgentButton_Click(Object sender, EventArgs e) in d:\hosting\inetguys\fastchat\steiner\ManageDepartments.aspx:233
                System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
                System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
                System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
                System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
                System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
                System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
                


    Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

    Scott
View Complete Thread