Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » System.IndexOutOfRangeException: DiscountAmountProductFieldName

System.IndexOutOfRangeException: DiscountAmountProductFieldName

Gaëtan Di Caro
Reply

Hi,

When I try to display a product catalogue module, either product list or product details, I get this exception :

System.IndexOutOfRangeException: DiscountAmountProductFieldName
   at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
   at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
   at System.Data.SqlClient.SqlDataReader.get_Item(String name)
   at Dynamicweb.Ecommerce.Orders.Discounts.Discount.Fill(IDataReader reader)
   at Dynamicweb.Ecommerce.Orders.Discounts.Discount.get_CachedDiscounts()
   at Dynamicweb.Ecommerce.Orders.Discounts.Discount.GetOrderLineDiscounts()
   at Dynamicweb.Ecommerce.Orders.Discounts.DiscountInfoCollection.LoadDiscounts()
   at Dynamicweb.Ecommerce.Products.Product.DiscountMatrix()
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties, Template template, Int32 loopCounter, Boolean renderRelated, String productUrl, Int32 quantity, Int32 wishListId, Boolean renderPublicList, Int32 orderLineOfProductCount)
   at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties)
   at Dynamicweb.Ecommerce.Frontend.Frontend.RenderProduct(Product product)
   at Dynamicweb.Ecommerce.Frontend.Frontend.EcomRender()
   at Dynamicweb.Ecommerce.Frontend.Frontend.GetContent()
   at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)

Any idea where that comes from ?

 

Thanks


Replies

 
Nicolai Pedersen
Reply

Hi Gaëtan

It is a missing database update you are hit by.

Go to Settings->System->System information and set the ecom update field to 2000 and click "rerun updates", see dump

Capture.PNG
 
Gaëtan Di Caro
Reply

Unfortunately it didn't change anything. However my values are 2012 and 2023.

 
Nicolai Pedersen
Reply

Then you should take a look at the log in the same screen.

Have you ensured that the SQL user has DDL permissions? (See installation guide)

 
Gaëtan Di Caro
Reply

Here's my log, there seems to be some errors in there, but I'm not sure if they're related or even actually problematic. My sql user is dbo on this database, so there shouldn't be any right issue

 
Nicolai Pedersen
Reply

It says a lot of times that you do not have permissions... So I would go check the user permissions...

Also, your log goes to 2012, and the field you are missing is in package 2013 - so that implies that your /admin is not in sync with your /bin.

 
Gaëtan Di Caro
Reply

Hm, that's weird. Here's what I did to make sure everything was good :

  • Manually delete the whole bin and admin folders
  • Copy those from the 9.1.4 zip
  • In sql, make sure the user is dbo and update the login on my database
  • Compile my solution again
  • Run both updates from 2000

And it still stops at 2012 and 2023... Is there anything I overlooked ?

 
Nicolai Pedersen
Reply

Hm, could be a bug in our release....

Will get on this right away!

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Gaëtan

We have updated the zip file in the download section to fix this issue. So if you download 9.1.4 again and run the update.

Sorry about the inconvenience!

BR Nicolai

Votes for this answer: 1
 
Gaëtan Di Caro
Reply

Cool, much better now :)

(and by "much better", I mean "moving on to the next error")

 

Thanks !

 

You must be logged in to post in the forum