The index expression is simply on the field which is a numeric type N(10,0). The cursor created by the xmlAdapter shows numeric type N(20,19) which seems a bit odd. The value in the cursor appears as 29131.00000000000000
>Hi Michael,
>
>Is the type of the index expression the same as the type of the header.tempno field?
>
>Aleksey.
>
>
>>I’m sending a dataset from .NET 2.0 to a VFP web service. When I receive the data into VFP there appears to be something strange happening with numeric fields.
>>
>>You can save numeric data and perform arithmetic operations with no problem. If I take a numeric value and attempt a seek on a table it will not find the matching record. If I perform any type of arithmetic op on the value prior to the seek it will find the record.
>>
>>VFP Test code:
>>PROCEDURE UpdateTemplate(lcXMLDataSet as String) as String
>> LOCAL loXMLAdapter AS XMLAdapter
>> loXMLAdapter = CREATEOBJECT("XMLAdapter")
>> loXMLAdapter.LoadXML(lcXMLDataSet)
>> loXMLAdapter.Tables(1).ToCursor(.f.,"header")
>> loXMLAdapter.Tables(2).ToCursor(.f.,"detail")
>> loXMLAdapter.Tables(3).ToCursor(.f.,"smartcode")
>> USE (datapath + "gphmast.dbf") SHARED IN 0
>> USE (datapath + "gphdtail.dbf") SHARED IN 0
>> USE (datapath + "gphesc.dbf") SHARED IN 0
>> SELECT header
>> m.tempno = tempno
>> SELECT gphmast
>> SET ORDER TO tempno
>> IF SEEK(m.tempno)
>> rtnval = "Record Found!"
>> ELSE
>> rtnval = "Template " + str(m.tempno) + " Not found.
>> ENDIF
>> RETURN rtnval
>>ENDPROC
>>
>>If I change the seek to: “SEEK (m.tempno+0)” it finds the matching record.
>>Other commands that failed were:
>>LOCATE FOR tempno = m.tempno
>>SELECT * FROM gphmast where tempno = m.tempno
>>
>>If I locate the record and compare it will match
>>SELECT (29131)
>>Compairing Tempno = m.Tempno returns true
>>
>>When I save the received data into the datatable everything looks ok. It seems to be something with using the numeric value against a table index.
>>
>>The XML string received by the VFP web service has the value defined as:
>>Schema:
>>
<xs:element name="tempno">
>> <xs:simpleType>
>> <xs:restriction base="xs:decimal" />
>> </xs:simpleType>
>></xs:element>
>>Data:
>> <tempno>29131</tempno>
>>
>>
>>When I run similar code from the command window (pulling the xml from a file) it finds the record.
>>
>>Can anybody shed some light on what is happening here?
>>
>>Thanks,
Michael McLain