Event viewer error - ASP.NET 2.0.50727.0 - Event ID: 1309

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 29/10/2008 12:36:06
Event time (UTC): 29/10/2008 12:36:06
Event ID: 7873d8a611ad445d998db4fdef25a5c9
Event sequence: 728
Event occurrence: 9
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/2036148338/Root-5-128697466270360000
Trust level: Full
Application Virtual Path: /
Application Path: D:\WebFolders\test.thegmach.com\
Machine name: FORMWEB3
Process information:
Process ID: 148
Process name: w3wp.exe
Exception information:
Exception type: SqlException
Exception message: INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_CategoryRelationship_Category'. The conflict occurred in database 'thegmach', table 'Category', column 'ID'.
The statement has been terminated.
Request information:
Request URL: http://test.thegmach.com/relatedcategories.aspx 
Request path: /relatedcategories.aspx
User host address:
Is authenticated: False
Authentication Type:
Thread information:
Thread ID: 7
Is impersonating: False
Stack trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader()
at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
at System.Data.Linq.ChangeDirector.StandardChangeDirector.DynamicInsert(TrackedObject item)
at System.Data.Linq.ChangeDirector.StandardChangeDirector.Insert(TrackedObject item)
at System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode)
at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
at System.Data.Linq.DataContext.SubmitChanges()
at relatedcategories.Add_Click(Object sender, EventArgs e) in D:\WebFolders\test.thegmach.com\relatedcategories.aspx.vb:line 59
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Who is Participating?
David RobitailleConnect With a Mentor Analyst ProgrammerCommented:
Well, as you said,  it s a programming error. You should not worry too much about it...
If the site is still in testing mode, they should be aware of it, because they could left "debug="true"" in their web config. Then they got a debug error on the web page explaining the problem in a similar manner the in the event log. But they may not left it to true for security reason.
You could forward them that error, the Request URL (http://test.thegmach.com/relatedcategories.aspx )
 and the "Event time" of it.
Also, ask them if they want to be noticed of these error. Personally, if I " just administer there server" i won`t want to check those too often. So you could say that you could send them on request. Or you could just said them to do better programming :-)
David RobitailleAnalyst ProgrammerCommented:
the important part is :
Exception type: SqlException
Exception message: INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_CategoryRelationship_Category'. The conflict occurred in database 'thegmach', table 'Category', column 'ID'.
If you need more help, could you provide more info on what you are doing?
YellowbusTeamAuthor Commented:
The below is what I believe they are trying to do, which relates to the piece of code you highlighted above.

They are trying to insert a new record in SQL server which needs to relate to another record, but that record doesnt exist.
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

David RobitailleAnalyst ProgrammerCommented:
Well, i know that. but what is your question and how could I help you?
YellowbusTeamAuthor Commented:
Well im not to sure as they are a client of our and we just administer there server, they did inform however that it isn't anything to worry about and the site is still in testing mode.

Should we/they be worried about this error?
David RobitailleAnalyst ProgrammerCommented:
did that answer your question?
YellowbusTeamAuthor Commented:
Yeah it did cheers mate
David RobitailleAnalyst ProgrammerCommented:

Why did i get a "B"
"an answer is worth an A, unless it doesn't resolve your issue"
YellowbusTeamAuthor Commented:
Sorry about that, i din't fully understand how the grading system worked.

your answer was of great help to us
David RobitailleAnalyst ProgrammerCommented:
That was the feeling i had. Could you please "Request Attention" to change the grade?
"How can I change a grade?
If you feel you have graded a solution incorrectly, click the Request Attention button and the Moderators will change it for you."
 Glad I could help!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.