DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 12 Jul 2007 09:22:01 -0700,    posted on: microsoft.public.dotnet.framework.adonet        back       

Thread Index
  1    Amir Tohidi


DataSet.ReadXml and "Input string was not in a correct format."   
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
Date:Thu, 12 Jul 2007 09:22:01 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us