locked
one error when i del a Category. RRS feed

  • Question

  • User-1315434892 posted

    One error when i del a Category. 

    the report is:

    Server Error in '/TimeTracker' Application.
    --------------------------------------------------------------------------------

    The DELETE statement conflicted with the REFERENCE constraint "FK_TimeTracker_TimeEntry_IssueTracker_ProjectCategories". The conflict occurred in database "C:\TIMETRACKER\APP_DATA\TIMETRACKER.MDF", table "dbo.aspnet_starterkits_TimeEntry", column 'CategoryId'.
    The statement has been terminated.
    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.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_TimeTracker_TimeEntry_IssueTracker_ProjectCategories". The conflict occurred in database "C:\TIMETRACKER\APP_DATA\TIMETRACKER.MDF", table "dbo.aspnet_starterkits_TimeEntry", column 'CategoryId'.
    The statement has been terminated.

    Source Error:


    Line 636:                sqlCmd.Connection = cn
    Line 637:                cn.Open()
    Line 638:                sqlCmd.ExecuteScalar()
    Line 639:
    Line 640:            End Using

    who can help me?Thanks very much!
     

    Wednesday, February 11, 2009 9:57 PM

All replies

  • User-1315434892 posted

    Thank you for this link.

    But my problem is not solve.Now i find a new issue also about Category. When I edit something ,then clink the button of "Edit",there have error:categoryName
    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.NullReferenceException: categoryName

    Source Error:


    Line 322:
    Line 323:            If String.IsNullOrEmpty(CategoryName) Then
    Line 324:                Throw New NullReferenceException("categoryName")
    Line 325:            End If
    Line 326:
     

    Thursday, February 12, 2009 12:57 AM
  • User555306248 posted

    You can try this

    If String.IsNullOrEmpty(CategoryName) Then
             //Here you can show the user friendly message like

             Response.Write("Please select CategoryName");


    End If

    Thursday, February 12, 2009 10:29 PM
  • User555306248 posted

    Can you updated the status of your thread

    Wednesday, March 25, 2009 11:23 PM
  • User555306248 posted

    Can you update the status of thread

    Tuesday, April 14, 2009 11:23 PM