Developer forum

Forum » Ecommerce - Standard features » .Net error
Lars Larsen
Lars Larsen
Reply

Hi

I have just added an order field (CprNbr). And now I get the error below when trying to open the orderlist in the backend. The field is correctly created in the database tables "EcomOrders" and "EcomOrderField". What is causing the problem? I am running Dynamicweb v9.9.1

Server Error in '/' Application.


CprNbr

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.IndexOutOfRangeException: CprNbr

Source Error:

 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:
 

[IndexOutOfRangeException: CprNbr]
   System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) +2151215
   System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) +141
   System.Data.SqlClient.SqlDataReader.get_Item(String name) +21
   Dynamicweb.Ecommerce.Orders.OrderFieldValueCollection..ctor(IDataReader dataReader) +252
   Dynamicweb.Ecommerce.Orders.OrderRepository.ExtractOrder(IDataReader reader) +12974
   Dynamicweb.Ecommerce.Orders.BackendOrderRepository.GetOrders() +174
   Dynamicweb.Admin.UCOrderList.FillList() +342
   Dynamicweb.Admin.UCOrderList.LoadList() +848
   System.Web.UI.Control.OnPreRender(EventArgs e) +11725240
   Dynamicweb.Controls.List.OnPreRender(EventArgs e) +462
   System.Web.UI.Control.PreRenderRecursiveInternal() +132
   System.Web.UI.Control.PreRenderRecursiveInternal() +227
   System.Web.UI.Control.PreRenderRecursiveInternal() +227
   System.Web.UI.Control.PreRenderRecursiveInternal() +227
   System.Web.UI.Control.PreRenderRecursiveInternal() +227
   System.Web.UI.Control.PreRenderRecursiveInternal() +227
   System.Web.UI.Control.PreRenderRecursiveInternal() +227
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4005

 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4075.0


Replies

 
Lars Larsen
Lars Larsen
Reply

The problem was that the field "CprNbr" was transfered from dev to test with the Deployment tool which creates the field in the table "EcomOrderField" but not in the table "EcomOrders" - thought the field was created but had looked in the wrong database!! Created the field in the table "EcomOrders" by editing the orderfield and saving the orderfield in the backend.

 
Nicolai Pedersen
Reply

Well, the exception indicates that the field is not in the table (EcomOrders). Could indicate you are missing ddl permissions on your SQL user.

I cannot reproduce anyways - see attachment.

Capture.JPG
 
Nicolai Pedersen
Reply
This post has been marked as an answer

ok - explains. Remember to add a schema provider for the ecomorders table to the deployment job.

Also - CPR = the danish CPR number. Can be an issue to store in this database under GDPR and other funny stuff....

Votes for this answer: 1
 
Lars Larsen
Lars Larsen
Reply

Hi Nicolai

Yes I am aware of CPR smiley. Thanks

 

You must be logged in to post in the forum