an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Support > Using DotShoppingCart > Deleting products completely
Last Post 3/26/2008 3:54:58 PM By lukezy. 7 replies.
3/25/2008 2:27:29 PM
jmlee
Posts: 11
Joined: 4/23/2008
Deleting products completely

I am trying to set up a store, and I happened to have install the storefront with the demo data.

I am trying to delete the demo products from the database...but can't seem to do it.  I dis-associated the products from the categories, but and they don't show up on the front-end, but i have a feeling that those products are still there as the the counter next to the categories still show that those products are in existence.

Is the counter next to the categories cached? or is there a more definite way to delete the products completely using the admin interface.

By the way, i am running ver 1.1

thanks,

Jerry

3/25/2008 2:32:40 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Deleting products completely

Does http://www.dotshoppingcart.com/View/Article/Documentation/Online%20Help/Product%20Management/Managing%20Products/36.aspx help?

DotShoppingCart Staff
3/25/2008 10:52:28 PM
jmlee
Posts: 11
Joined: 4/23/2008
Re: Deleting products completely

Hi Luke,

No, your procedure was what i had followed...but when i tried to delete the item, it would generate an exception error...

 Type : System.Reflection.TargetInvoca<wbr></wbr>tionException, mscorlib, Version=<a href="http://2.0.0.0/" target="_blank">2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08<wbr></wbr>9
       Message : Exception has been thrown by the target of an invocation.
       Source : mscorlib
       Help link :
       Data : System.Collections.ListDiction<wbr></wbr>aryInternal
       TargetSite : System.Object _InvokeMethodFast(System.Object, System.Object[], System.SignatureStruct ByRef, System.Reflection.MethodAttrib<wbr></wbr>utes, System.RuntimeTypeHandle)
       Stack Trace :    at System.RuntimeMethodHandle.<wbr></wbr>_InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
          at System.RuntimeMethodHandle<wbr></wbr>.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
          at System.Reflection.RuntimeMetho<wbr></wbr>dInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
          at System.Reflection.RuntimeMetho<wbr></wbr>dInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
          at System.Web.UI.WebControls<wbr></wbr>.ObjectDataSourceView.InvokeMe<wbr></wbr>thod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance)
          at System.Web.UI.WebControls<wbr></wbr>.ObjectDataSourceView.InvokeMe<wbr></wbr>thod(ObjectDataSourceMethod method)
          at System.Web.UI.WebControls<wbr></wbr>.ObjectDataSourceView.ExecuteD<wbr></wbr>elete(IDictionary keys, IDictionary oldValues)
          at System.Web.UI.DataSourceView<wbr></wbr>.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallbac<wbr></wbr>k callback)
          at System.Web.UI.WebControls<wbr></wbr>.GridView.HandleDelete(GridViewRow row, Int32 rowIndex)
          at System.Web.UI.WebControls<wbr></wbr>.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup)
          at System.Web.UI.WebControls<wbr></wbr>.GridView.OnBubbleEvent(Object source, EventArgs e)
          at System.Web.UI.Control.RaiseBub<wbr></wbr>bleEvent(Object source, EventArgs args)
          at System.Web.UI.WebControls<wbr></wbr>.GridViewRow.OnBubbleEvent(Object source, EventArgs e)
          at System.Web.UI.Control.RaiseBub<wbr></wbr>bleEvent(Object source, EventArgs args)
          at System.Web.UI.WebControls<wbr></wbr>.Button.OnCommand(CommandEventArgs e)
          at System.Web.UI.WebControls<wbr></wbr>.Button.RaisePostBackEvent(String eventArgument)
          at System.Web.UI.WebControls<wbr></wbr>.Button.System.Web.UI.IPostBac<wbr></wbr>kEventHandler.RaisePostBackEve<wbr></wbr>nt(String eventArgument)
          at System.Web.UI.Page.RaisePostBa<wbr></wbr>ckEvent(IPostBackEventHandler sourceControl, String eventArgument)
          at System.Web.UI.Page.RaisePostBa<wbr></wbr>ckEvent(NameValueCollection postData)
          at System.Web.UI.Page.ProcessRequ<wbr></wbr>estMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

               Inner Exception
               ---------------
               Type : System.Data.SqlClient.SqlExcep<wbr></wbr>tion, System.Data, Version=<a href="http://2.0.0.0/" target="_blank">2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08<wbr></wbr>9
               Message : The DELETE statement conflicted with the REFERENCE constraint "FK_DSC_Product_Review_DSC<wbr></wbr>_Product". The conflict occurred in database "dotcart", table "dbo.DSC_Product_Review", column 'productId'.
The statement has been terminated.
               Source : .Net SqlClient Data Provider
               Help link :
               Errors : System.Data.SqlClient.SqlError<wbr></wbr>Collection
               Class : 16
               LineNumber : 33
               Number : 547
               Procedure : DSC_Product_Delete
               Server : localhost
               State : 0
               ErrorCode : -2146232060
               Data : System.Collections.ListDiction<wbr></wbr>aryInternal
               TargetSite : Void OnError(System.Data.SqlClient.SqlExcep<wbr></wbr>tion, Boolean)
               Stack Trace :    at System.Data.SqlClient.SqlConne<wbr></wbr>ction.OnError(SqlException exception, Boolean breakConnection)
                  at System.Data.SqlClient.SqlInter<wbr></wbr>nalConnection.OnError(SqlException exception, Boolean breakConnection)
                  at System.Data.SqlClient.TdsParse<wbr></wbr>r.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
                  at System.Data.SqlClient.TdsParse<wbr></wbr>r.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
                  at System.Data.SqlClient.SqlComma<wbr></wbr>nd.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
                  at System.Data.SqlClient.SqlComma<wbr></wbr>nd.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
                  at System.Data.SqlClient.SqlComma<wbr></wbr>nd.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
                  at System.Data.SqlClient.SqlComma<wbr></wbr>nd.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
                  at System.Data.SqlClient.SqlComma<wbr></wbr>nd.ExecuteNonQuery()
                  at Microsoft.Practices.Enterprise<wbr></wbr>Library.Data.Database.DoExecut<wbr></wbr>eNonQuery(DbCommand command)
                  at Microsoft.Practices.Enterprise<wbr></wbr>Library.Data.Database.ExecuteN<wbr></wbr>onQuery(DbCommand command)
                  at XShan.DotShoppingCart.Common<wbr></wbr>.Object.Product.Delete(Int32 productId) in C:\Inetpub\wwwroot\DotShop1<wbr></wbr>\Common\Object\Product.cs:line 703 

 

 

Category: General
Priority: 0
EventId: 100
Severity: Error
Title:Enterprise Library Exception Handling
Machine: localweb
Application Domain: /LM/W3SVC/12964/Root-1-1285098<wbr></wbr>36391023412
Process Id: 4036
Process Name: c:\windows\system32\inetsrv<wbr></wbr>\w3wp.exe
Win32 Thread Id: 32296
Thread Name:
Extended Properties: Url - <a href="http://localhost/Admin/Catalog/Products.aspx" target="_blank">http://localhost/Admin<wbr></wbr>/Catalog/Products.aspx
RawUrl - /Admin/Catalog/Products.aspx
UseAgent - Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
UrlReferrer - <a href="http://localhost/Admin/Catalog/Products.aspx" target="_blank">http://localhost/Admin<wbr></wbr>/Catalog/Products.aspx
IPAddress - 10.10.10.1

3/25/2008 10:59:03 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Deleting products completely

Ah, you need to remove product reviews first and then delete the products.

DotShoppingCart Staff
3/26/2008 9:21:48 AM
jmlee
Posts: 11
Joined: 4/23/2008
Re: Deleting products completely

Hi Luke,

You are exactly right...there was a review tied to the product id.

But now my question is how does the category counters get reset...i saw that there is a table in the database holding these values, but not sure how those get updated.  Apparently they didn't get updated when the products were removed from the database.

-Jerry

3/26/2008 9:39:00 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Deleting products completely

I created a blog entry about this.Check http://www.dotshoppingcart.com/View/Article/DotShoppingCart%20Blog/OpenSource%20Edition/106.aspx.

DotShoppingCart Staff
3/26/2008 2:31:33 PM
jmlee
Posts: 11
Joined: 4/23/2008
Re: Deleting products completely

Good information.  But it didn't really show how I can fix the problem.  As it's been more than a day, and the category counter still hasn't reset.

But i realized that the installation process is very confusing for this package...the web.config that is updated after an installation still puts in the path to the install directory, but if the install directory is different than the actual directory for where the webpages are located/hosted, then it creates problems. Even after i create a virtual directory in IIS and copy the web store over to the new folder, the web config still references and needs write privilege to the original install directory. Very strange, i am hoping that after i fix this, now the counter would get fixed as well.

3/26/2008 3:54:58 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Deleting products completely

It's probably that your orderpieline doesn't get run at all. You could manuall run sproc "EXEC DSC_Category_Populate_Manufacture_Count 0, 0" and "EXEC DSC_Category_Populate_PriceRange_Count 0, 0" manually via the DB back end.

The installation is just to give you a shortcut to get things started. If you want to move the install directory or something else, you can read the code of InstDSC since the code is released. I will document how you can install manually when I get the chance. 

 

DotShoppingCart Staff