error conflict occurred in database

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
15 лет назад
Hello,

i hope somebody can help!
I created virtual directory named 'nopcommerce' by IIS and then link it to the location of extracted nopcommerce files. i created by SQL Server 2008 Management Studio a database named nopcommerce and excuted the two data base files in it. I opened the web site by Visual studio 2008. I modified the web.config as below:

connectionString="Data Source=AMD25\SQLEXPRESS;Initial Catalog=nopcommerce;Integrated Security=True;User ID=alex;Password=****"

something important to note that nopcommerce application on IIS configured to work with ASP.NET 2 because i can't see the the option ASP.NET 3.5.

Here is the error i had:

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'.
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 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'.
The statement has been terminated.

Source Error:


Line 40:         {
Line 41:             Language language = NopContext.Current.WorkingLanguage;
Line 42:             return LocalizationManager.GetLocaleResourceString(ResourceName, language.LanguageID);
Line 43:         }
Line 44:     }


Source File: e:\webSites\nopCommerce\nopCommerce_1.05\NopCommerce\NopCommerceWeb\App_Code\BaseNopUserControl.cs    Line: 42

Stack Trace:
15 лет назад
Open [Nop_LogType] table. Check if all records are synchronize with LogTypeEnum enum:


/// <summary>
    /// Represents a log item type (need to be synchronize with [Nop_LogType] table)
    /// </summary>
    public enum LogTypeEnum : int
    {
        /// <summary>
        /// Unknown log item type
        /// </summary>
        Unknown = 0,
        /// <summary>
        /// Customer error log item type
        /// </summary>
        CustomerError = 1,
        /// <summary>
        /// Mail error log item type
        /// </summary>
        MailError = 2,
        /// <summary>
        /// Order error log item type
        /// </summary>
        OrderError = 3,
        /// <summary>
        /// Administration area log item type
        /// </summary>
        AdministrationArea = 4,
        /// <summary>
        /// Common error log item type
        /// </summary>
        CommonError = 5,
        /// <summary>
        /// Shipping error log item type
        /// </summary>
        ShippingErrror = 6,
        /// <summary>
        /// Tax error log item type
        /// </summary>
        TaxError = 7,
    }
15 лет назад
Would you tell me how to check if all records are synchronize with LogTypeEnum enum? I have SQL server 2008 Express and VWD 2008.

thanks
15 лет назад
Open the table.

Check if al logtypes are the same as one of the values in the logtypes enum.
If not, change it.
15 лет назад
I think it should be a bug because  now it works fine without doing any change!! it looks a nice application. thank you
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.