-
11365
-
101367
-
22.05.2011
-
United States
I've seen several posts about this for prior versions. May I suggest we fix it...
ImportManager.cs
public virtual void ImportProductsFromXls(string filePath)
change
foreach (DataRow dr in dt.Rows())
to
foreach (DataRow dr in dt.Select("name is not NULL"))
Similarly for another common import issue - 'Products$' is not a valid name.
Could we also trap that and then look for Sheet1$ ?
-
143
-
1083
-
23.11.2010
-
Canada
Hi,
This is an issue I've been struggling with for a while.
I'm currently looking in ImportManager.cs and I don't actually see that line.
In the function "ImportProductsFromXls" I see the:
foreach (DataRow dr in dt.Rows)
but not:
foreach (DataRow dr in dt.Rows())
I'm using nop 1.9 - I see you're using 2.0 beta (will look further into 1.9)
thanks
David
-
11365
-
101367
-
22.05.2011
-
United States
Yes, my orig post was based on 2.0 beta.
When 2.0 was released, this is the way the team fixed it:
foreach (DataRow dr in dt.Rows)
{
if (dr.ItemArray.All(i => string.IsNullOrEmpty(i.ToString())))
continue;
(i.e. if all the cells in the row are empty, then skip to next record)