473,396 Members | 2,151 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.

purpose of XmlConvert.ToString() ???

HI,

what is the purpose of XmlConvert.ToString() ?
why not just use Convert.ToString() ?

e.g.
Int32 vInt32 = -2147483648;
string s1 = XmlConvert.ToString(vInt32);
string s2 = Convert.ToString(vInt32);

s1 and s2 result in the same string.

so what is the added benefit ?

thnx
Chris
Nov 12 '05 #1
1 2848
Chris <ch********@pandora.be> wrote:
what is the purpose of XmlConvert.ToString() ?
why not just use Convert.ToString() ?

e.g.
Int32 vInt32 = -2147483648;
string s1 = XmlConvert.ToString(vInt32);
string s2 = Convert.ToString(vInt32);

s1 and s2 result in the same string.

so what is the added benefit ?


XmlConvert is guaranteed to use the appropriate format for XSD types.
For instance, a DateTime will always be formatted with
yyyy-MM-ddTHH:mm:ss as the format string, regardless of the culture.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 12 '05 #2

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

Similar topics

0
by: Jim M | last post by:
I use EncodeName in my server side ASPX VB code as shown below. xml_qdata = xml_qdata & "<NoteItem>" & System.Xml.XmlConvert.EncodeName(myReader.Item("Note")) & "</NoteItem>" I THEN LOAD...
2
by: Jon the Blind | last post by:
I'm looking for a way to retrieve data via System.Reflection.FieldInfo.GetValue (which returns an Object) and convert it to XML using XmlConvert.ToString. XmlConvert accepts only specified data...
2
by: Shawn Anderson | last post by:
I have a question and I think I know the answer, but I am looking for confirmation (and maybe a link to some documentation) I have an input string of: "2004-08-01T00:00:00-00:00" When I pass...
7
by: BBFrost | last post by:
I'm receiving decimal values from database queries and placing them on a report page. The users want to see the following .... Db Value Display Value 123.3400 123.34...
1
by: Chris | last post by:
HI, what is the purpose of XmlConvert.ToString() ? why not just use Convert.ToString() ? e.g. Int32 vInt32 = -2147483648; string s1 = XmlConvert.ToString(vInt32); string s2 =...
0
by: bcobra | last post by:
What am I doing wrong? the code: age Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %> <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"...
2
by: Soren S. Jorgensen | last post by:
Hi, The docs says (both local and on msdn) that XmlConvert contains methods ToBinHexString and FromBinHexString! But my compiler complains about not finding these methods! Are they not...
2
by: Berryl Hesh | last post by:
I'm interested in how experienced.Net developers might handle routine display tasks as a general strategy. Let's say you have a use in your domain for value objects that encapsulate a person's...
19
by: Michael C | last post by:
If we have something like this object x = null; MessageBox.Show(x.ToString()) we get an error. That kindof makes sense but there is no reason the behaviour couldn't be to return an empty...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.