Hi, I’m uplifting an existing bpm from 9.05 to 10.2.400. In the existing progress code we have a simple statement: OrderRel.OrderNum = INT(ttTFOrdDtl.ShortChar01). Note that ShortChar01 is of type nvarchar.
When I try this using C# I’m getting errors when I issue a similar statement: OrderRel.OrderNum = Convert.ToInt32(ttTFOrdDtl[“ShortChar01”]) 'Cannot convert from string to Int". If I try to use a variable to store the value of ttTFOrdDtl[“ShortChar01”] as a string I get the very same error.
I have tried variations of int.Parse(), Convert and even making everything a string, to no avail.
The code segment I’m working with:
string stringS01 = String.Empty;
int intS01 = 0;
var tfOrd = from ttTFOrdDtlRow in ttTFOrdDtl
where ttTFOrdDtlRow.RowMod == “A”
select ttTFOrdDtlRow[“ShortChar01”];
stringS01 = ttTFOrdDtl[“ShortChar01”]; // throws 'cannot convert from ‘string’ to ‘int’
intS01 = ttTFOrdDtl[“ShortChar01”]; // throws 'cannot convert from ‘string’ to ‘int’
intS01 = Convert.ToInt32(ttTFOrdDtl[“ShortChar01”]); // throws cannot convert from ‘string’ to ‘int’
stringS01 = Convert.ToString(ttTFOrdDtl[“ShortChar01”]); // throws cannot convert from ‘string’ to ‘int’
I must be doing/not doing something terribly basic because this does not seem like it should be at all complicated…??? Any help or pointing out of obvious gross errors is appreciated.
Thanks,Nick