2

I'm using a referenced DLL to retrieve data from a webservice. The data retrieves well. I copy over some of the fields to inMemory tables. This works well unless for the Int32 types.

Code example:

As you can see, the Id field is of type Int32. The table field (ProductId) is an Integer. This compiles without errors, but when i run the code i get the following error:

Error executing code: Wrong argument types in variable assignment.

This error points to the line with the productId. Removing it makes the code work. I've also tried making the Id a string, and then str2int() the field but that doesn't work either.

Any idea's?

Thanks, steve

stephan
  • 61
  • 8

1 Answers1

2

Try to marshal explicitly between the two types:

System.Int32 netInt;
int          xppInt;
;

// -- Other code
// ...
netInt = product.get_Id();
xppInt = netInt;
tempData.ProductId = xppInt;
DAXaholic
  • 33,312
  • 6
  • 76
  • 74