|
Group: Awaiting Activation
Last Login: 09 May 2012 13:51
Posts: 71,
Visits: 153
|
Ok, I don't fancy messing with SQL scripts. I'll just rename the option group to something else so it's obvious not to use.
Here's the error log anyway. Seems to be a CHECK constraint error. Obviously didn't like my edit for some reason...
----------------------------------------------------------------------------- >> OptionsBLL. ----------------------------------------------------------------------------- >> System.Data.SqlClient.SqlException >> 06/06/2011 14:22:31 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 86.160.20.219 >> CUSTOM MESSAGE: Database Error: reference-key violation. >> NUMBER:547 >> MESSAGE: The INSERT statement conflicted with the CHECK constraint "CK_ProductOptionLink_PriceChange". The conflict occurred in database "db360978420", table "dbo.tblKartrisProductOptionLink", column 'P_OPT_PriceChange'. The statement has been terminated. >> STACK: 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 OptionsBLL.(DataTable , SqlConnection , SqlTransaction ) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL._CreateProductOptions ----------------------------------------------------------------------------- >> System.ApplicationException >> 06/06/2011 14:22:31 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 86.160.20.219 >> CUSTOM MESSAGE: Error occurred while processing the operation. >> MESSAGE: Error occurred while processing the operation. >> STACK: at OptionsBLL._CreateProductOptions(Int32 pProductID, DataTable ptblOptionGroupList, DataTable ptblOptionsList, String& strMsg) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL. ----------------------------------------------------------------------------- >> System.Data.SqlClient.SqlException >> 06/06/2011 14:23:21 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 86.160.20.219 >> CUSTOM MESSAGE: Database Error: reference-key violation. >> NUMBER:547 >> MESSAGE: The INSERT statement conflicted with the CHECK constraint "CK_ProductOptionLink_PriceChange". The conflict occurred in database "db360978420", table "dbo.tblKartrisProductOptionLink", column 'P_OPT_PriceChange'. The statement has been terminated. >> STACK: 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 OptionsBLL.(DataTable , SqlConnection , SqlTransaction ) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL._CreateProductOptions ----------------------------------------------------------------------------- >> System.ApplicationException >> 06/06/2011 14:23:21 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 86.160.20.219 >> CUSTOM MESSAGE: Error occurred while processing the operation. >> MESSAGE: Error occurred while processing the operation. >> STACK: at OptionsBLL._CreateProductOptions(Int32 pProductID, DataTable ptblOptionGroupList, DataTable ptblOptionsList, String& strMsg) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL. ----------------------------------------------------------------------------- >> System.Data.SqlClient.SqlException >> 06/06/2011 14:23:39 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 86.160.20.219 >> CUSTOM MESSAGE: Database Error: reference-key violation. >> NUMBER:547 >> MESSAGE: The INSERT statement conflicted with the CHECK constraint "CK_ProductOptionLink_PriceChange". The conflict occurred in database "db360978420", table "dbo.tblKartrisProductOptionLink", column 'P_OPT_PriceChange'. The statement has been terminated. >> STACK: 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 OptionsBLL.(DataTable , SqlConnection , SqlTransaction ) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL._CreateProductOptions ----------------------------------------------------------------------------- >> System.ApplicationException >> 06/06/2011 14:23:39 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 86.160.20.219 >> CUSTOM MESSAGE: Error occurred while processing the operation. >> MESSAGE: Error occurred while processing the operation. >> STACK: at OptionsBLL._CreateProductOptions(Int32 pProductID, DataTable ptblOptionGroupList, DataTable ptblOptionsList, String& strMsg) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL. ----------------------------------------------------------------------------- >> System.Data.SqlClient.SqlException >> 06/06/2011 14:24:57 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 86.160.20.219 >> CUSTOM MESSAGE: Database Error: reference-key violation. >> NUMBER:547 >> MESSAGE: The INSERT statement conflicted with the CHECK constraint "CK_ProductOptionLink_PriceChange". The conflict occurred in database "db360978420", table "dbo.tblKartrisProductOptionLink", column 'P_OPT_PriceChange'. The statement has been terminated. >> STACK: 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 OptionsBLL.(DataTable , SqlConnection , SqlTransaction ) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL._CreateProductOptions ----------------------------------------------------------------------------- >> System.ApplicationException >> 06/06/2011 14:24:57 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 86.160.20.219 >> CUSTOM MESSAGE: Error occurred while processing the operation. >> MESSAGE: Error occurred while processing the operation. >> STACK: at OptionsBLL._CreateProductOptions(Int32 pProductID, DataTable ptblOptionGroupList, DataTable ptblOptionsList, String& strMsg) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL. ----------------------------------------------------------------------------- >> System.Data.SqlClient.SqlException >> 06/06/2011 14:26:27 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 86.160.20.219 >> CUSTOM MESSAGE: Database Error: reference-key violation. >> NUMBER:547 >> MESSAGE: The INSERT statement conflicted with the CHECK constraint "CK_ProductOptionLink_PriceChange". The conflict occurred in database "db360978420", table "dbo.tblKartrisProductOptionLink", column 'P_OPT_PriceChange'. The statement has been terminated. >> STACK: 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 OptionsBLL.(DataTable , SqlConnection , SqlTransaction ) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL._CreateProductOptions ----------------------------------------------------------------------------- >> System.ApplicationException >> 06/06/2011 14:26:27 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 86.160.20.219 >> CUSTOM MESSAGE: Error occurred while processing the operation. >> MESSAGE: Error occurred while processing the operation. >> STACK: at OptionsBLL._CreateProductOptions(Int32 pProductID, DataTable ptblOptionGroupList, DataTable ptblOptionsList, String& strMsg) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL. ----------------------------------------------------------------------------- >> System.Data.SqlClient.SqlException >> 06/06/2011 14:26:44 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 86.160.20.219 >> CUSTOM MESSAGE: Database Error: reference-key violation. >> NUMBER:547 >> MESSAGE: The INSERT statement conflicted with the CHECK constraint "CK_ProductOptionLink_PriceChange". The conflict occurred in database "db360978420", table "dbo.tblKartrisProductOptionLink", column 'P_OPT_PriceChange'. The statement has been terminated. >> STACK: 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 OptionsBLL.(DataTable , SqlConnection , SqlTransaction ) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL._CreateProductOptions ----------------------------------------------------------------------------- >> System.ApplicationException >> 06/06/2011 14:26:44 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 86.160.20.219 >> CUSTOM MESSAGE: Error occurred while processing the operation. >> MESSAGE: Error occurred while processing the operation. >> STACK: at OptionsBLL._CreateProductOptions(Int32 pProductID, DataTable ptblOptionGroupList, DataTable ptblOptionsList, String& strMsg) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL. ----------------------------------------------------------------------------- >> System.Data.SqlClient.SqlException >> 06/06/2011 17:43:18 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 212.159.76.170 >> CUSTOM MESSAGE: Database Error: reference-key violation. >> NUMBER:547 >> MESSAGE: The INSERT statement conflicted with the CHECK constraint "CK_ProductOptionLink_PriceChange". The conflict occurred in database "db360978420", table "dbo.tblKartrisProductOptionLink", column 'P_OPT_PriceChange'. The statement has been terminated. >> STACK: 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 OptionsBLL.(DataTable , SqlConnection , SqlTransaction ) ==================================================
----------------------------------------------------------------------------- >> OptionsBLL._CreateProductOptions ----------------------------------------------------------------------------- >> System.ApplicationException >> 06/06/2011 17:43:18 >> URL:http://mydomainhiddenfromforumview/Admin/_ModifyProduct.aspx?ProductID=13&CategoryID=17&strParent=8,13&strTab=options >> 212.159.76.170 >> CUSTOM MESSAGE: Error occurred while processing the operation. >> MESSAGE: Error occurred while processing the operation. >> STACK: at OptionsBLL._CreateProductOptions(Int32 pProductID, DataTable ptblOptionGroupList, DataTable ptblOptionsList, String& strMsg) ==================================================
Tags:
|
|
Group: Awaiting Activation
Last Login: 09 May 2012 13:51
Posts: 71,
Visits: 153
|
ADDENDUM
I tried recreating the option group again and the same error occurred, but there was a way to get the option group 'accepted', though it's not a fix.
I'm experimenting with an options product with a base price of £539.00.
I created an options group for different sizes (I'll call it options group A for example).
I then created an options group for different configurations of the product (I'll call it options group B for example).
There was a requirement to offer an option of the product without certain features at a cheaper price. The obvious place to add these options was within options group B. This product would be £140 cheaper so I entered -140.00 in the Price setting in the option values. It was after I tried to save options group B that the error occurred.
However, going back to options group B and removing the -140.00 so every Price value was set to zero allowed me to save it successfully. Unfortunately, this isn't the answer as the cheaper option will not be reflected by price.
Is the Price option value attribute supposed to be able to take + / - figures to reflect different options within a single option group or do I have to create a separate option group to set up + / - price differences?
|
|
Group: Awaiting Activation
Last Login: 09 May 2012 13:51
Posts: 71,
Visits: 153
|
Ok, thanks for that.
So, just before I run this can I confirm that after backing up my database I go to the backend, Database Admin\Run Query and past this command in in the box and execute it?
I've had a look on the web and found the CONSTRAINT clause in SQL and what it does so I understand what this command in removing. I see it also appears in Access but it was never covered that on the Access courses I went on.
Many thanks again for your help.
|