The INSERT statement conflicted with the FOREIGN KEY constraint

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
15 years ago
System.Data.SqlClient.SqlException was unhandled by user code
  Message="The INSERT statement conflicted with the FOREIGN KEY constraint \"FK_Nop_Log_Nop_LogType\". The conflict occurred in database \"NopCommerce\", table \"dbo.Nop_LogType\", column 'LogTypeID'.\r\nThe statement has been terminated."
  Source=".Net SqlClient Data Provider"
  ErrorCode=-2146232060
  Class=16
  LineNumber=15
  Number=547
  Procedure="Nop_LogInsert"
  Server="192.168.1.10"
  State=0
  StackTrace:
       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.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.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteNonQuery(DbCommand command)
       at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DbCommand command)
       at NopSolutions.NopCommerce.Common.DAL.Managers.LogDBManager.InsertLog(Int32 LogTypeID, Int32 Severity, String Message, String Exception, String IPAddress, Int32 CustomerID, String PageURL, DateTime CreatedOn) in D:\Work\Own\NopCommerce\Solution\NopCommerce\Nop.Common\DAL\Managers\LogDBManager.cs:line 113
       at NopSolutions.NopCommerce.Common.BLL.Managers.LogManager.InsertLog(LogTypeEnum LogType, Int32 Severity, String Message, String Exception, String IPAddress, Int32 CustomerID, String PageURL) in D:\Work\Own\NopCommerce\Solution\NopCommerce\Nop.Common\BLL\Managers\LogManager.cs:line 111
       at NopSolutions.NopCommerce.Common.BLL.Managers.LogManager.InsertLog(LogTypeEnum LogType, String Message, String Exception) in D:\Work\Own\NopCommerce\Solution\NopCommerce\Nop.Common\BLL\Managers\LogManager.cs:line 91
       at ASP.global_asax.Application_Error(Object sender, EventArgs e) in e:\Office\Others\NCommerce\nopCommerce_1.05\NopCommerce\NopCommerceWeb\Global.asax:line 39
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Web.HttpApplication.RaiseOnError()
  InnerException:
15 years ago
Look at LogTypeEnum enumeration (need to be synchronize with [Nop_LogType] table).
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.