473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

XmlDeserialization error - Input string was not in a correct format

RJN
Hi

I'm getting an error while deserializing an xml into object.

[FormatException: Input string was not in a correct format.]
System.Number.ParseDouble(String s, NumberStyles style,
NumberFormatInfo info) +0
System.Double.Parse(String s, NumberStyles style, IFormatProvider
provider) +208
System.Xml.XmlConvert.ToDouble(String s)

How do I overcome this?

This is my deserializing code

XmlTextReader xtr = new XmlTextReader(oStream);
System.Xml.Serialization.XmlSerializer oSerializer = new
System.Xml.Serialization.XmlSerializer(typeof(Serv icePartners));
ServicePartners objPartnerData =
(ServicePartners)oSerializer.Deserialize(xtr);

I was getting another error "String was not recognized as a valid time"
which I overacme by applying the attribute
[System.Xml.Serialization.XmlIgnoreAttribute()]. Is this the right way?

Regards

rjn
*** Sent via Developersdex http://www.developersdex.com ***
Mar 16 '06 #1
1 5780
You should problably use the IFormatProvider parameter ToDouble(string,
IFormatProvider)
Mabye you are trying to convert 3.1 when ToDouble needs 3,1 to work.

/Magnus

Mar 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: hpy_awad | last post by:
I wrote that example from a book and there is en error in the display module that it does not showing all the records are entered in the input module. I traced with some printf statments without...
2
by: Rob Meade | last post by:
Hi all, I have a webform containing about 9 web user controls, these primarily are just html in a control thats used as the template etc.. A colleague has given me another control for our...
3
by: Bruce D | last post by:
I'm new to .NET and I have a error that is coming up but it's not telling me where the error is coming from (no file). Is that because I'm doing something wrong...or is it a type of error that has...
1
by: amitbadgi | last post by:
Welcome back amitbadgi | Logout | Faq Knowledge Discovery Keys COMPUTER PROGRAMMING, DATA MINING, STATISTICS, ARTIFICIAL INTELLIGENCE * Settings * Photos * Lists * MVPs * Forums * Blogs
7
by: M C | last post by:
Hi, This is a problem that has been haunting me for days and I've come to a complete dead-end. I'm using a objectdatasource to select and update a gridview control. Populating with select works...
0
by: sehguh | last post by:
Hiya Folks, I am Currently using windows xp. Also using Visual Web Developer 2005 and Microsoft Sql server 2005. The main page consists of an aspx page and a master page. The page also...
1
by: sehguh | last post by:
Hello folks I have recently been studying a book called "sams teach yourself asp.net 2.0 in24 hours by scott mitchell. I have reached page 614 but when i tried to run an asp page called...
1
by: arial | last post by:
Hi all, I am getting this error message and I don't know why? Input string was not in a correct format. Description: An unhandled exception occurred during the execution of the current web...
1
by: differentsri | last post by:
THIS IS AN ASP.NET 1.1 APPLICATION IAM TRYING TO UPDATE THE FIELD BUT I AM NOT ABLE TO UPDATE IT? CAN U TELL THE REASON ? IT IS GIVING THE FOLLOWING ERROR BELOW I HAVE ALSO GIVEN THE CODE OF...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.