PC Review


Reply
Thread Tools Rate Thread

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

 
 
=?Utf-8?B?QW1pciBUb2hpZGk=?=
Guest
Posts: n/a
 
      12th Jul 2007
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to prevent "Input string was not in a correct format" in DataGridView Pieter Coucke Microsoft Dot NET Framework 3 19th Apr 2006 11:12 PM
How to prevent "Input string was not in a correct format" in DataGridView Pieter Coucke Microsoft ADO .NET 5 19th Apr 2006 11:12 PM
How to prevent "Input string was not in a correct format" in DataGridView Pieter Coucke Microsoft Dot NET 3 19th Apr 2006 11:12 PM
How to prevent "Input string was not in a correct format" in DataGridView Pieter Coucke Microsoft VB .NET 3 19th Apr 2006 11:12 PM
Convert.Int32("0")causes{"Input string was not in a correct format =?Utf-8?B?SmFtZXMgUG9zZQ==?= Microsoft Dot NET 1 23rd Feb 2006 03:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:01 AM.