Developer forum

Forum » Development » Data import parse fails

Data import parse fails

Marco Santos
Reply

Morning.

I am getting errors on values that I am trying to import, and not sure why, as they seem correct. This is the error:

Import job failed: cannot parse '1753-01-01' to a System.DateTime. Table: EcomProducts. Column: stock2Date The failed input row is: [ProductID:"250"], [ProductNumber:"25080"], [ProductVariantID:""], [ProductName:"Inlay Outline"], [ProductStock:"86"], [productType2:"Inlay"], [Highlight:"False"], [ViewOnWeb:"True"], [ViewInShop:"True"], [NOS:"False"], [GroupID:"GROUPINLAY"], [ProductVariantCounter:"8"], [stock2:"0"], [stock2Date:"1753-01-01"], [stock3:"0"], [stock3Date:"1753-01-01"], [stock4:"0"], [stock4Date:"1753-01-01"], [stock5:"0"], [stock5Date:"1753-01-01"], [stock6:"0"], [stock6Date:"1753-01-01"], [stock7:"0"], [stock7Date:"1753-01-01"], [stock8:"0"], [stock8Date:"1753-01-01"]

I have also got the error " cannot parse '0' to a System.Int32" previously. Looking at the row printed, it seems also that all the fieds are mapped as string, and they are not, but this might just be the way the output was formatted.  Any ideias on how to get around this?

On a related topic, how do I set values to null on Data Import? I have tried using the Nullable<> types, but it does not work.

Thanks.

Marco.


Replies

 
Marco Santos
Reply

Update:

After changing the additional stock amounts to int (from Int32), the import works. Just need to know how do I go about setting values to null now. :)

Thanks.

 
Jonas Krarup Dam
Reply
This post has been marked as an answer

Hi Marco,

 

Which source are you using?

if you are using the XML provider as source, you should add the isNull="true" attribure to the node that you wish to set to null

if you are using the CSV provider, you should send in the string "NULL"

if you are creating your own provider, you should send in System.DBNull.Value

 

Regards, Jonas

Votes for this answer: 1

 

You must be logged in to post in the forum