DataSet.ReadXml and "Input string was not in a correct format."

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a strongly typed dataset which I am trying to populate with data from
an XML document. I am getting the error:

Input string was not in a correct format.

The problem is that one of the columns in one of the dataset's tables is of
type double:

<xs:element name="TotalBalance" type="xs:double" minOccurs="0" />

The XML document that I am being sent contains an empty element for this
column:

<TotalBalance></TotalBalance>

Obviously an empty string, which is how the above element is being
interpreted, can not be cast to a double. There many similar instances in the
documents that I am receiving.

Is there a simple way of telling my dataset to ignore such empty elements
for value types? I could parse and clean the XML myself prior to calling
ReadXml() but I really don't want to do that.

Thanks
Amir
 
Back
Top