473,324 Members | 1,856 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,324 software developers and data experts.

String TO xml (xml string)

I am trying to take a string and convert it to a data
source. The string is Xml that I am pulling out of
sharepoint and looks like this:

<Field FromBaseType="TRUE" Type="Choice" Name="Status"
ColName="nvarchar1" DisplayName="Status">
<CHOICES>
<CHOICE>Active</CHOICE>
<CHOICE>Resolved</CHOICE>
<CHOICE>Closed</CHOICE>
</CHOICES>
<Default>Active</Default></Field>

This is about all I have come up with but of course it
doesn't work:
String xmlData1 = oList.Fields.GetField
("Status").SchemaXml.ToString();

DataGrid1.DataSource = xmlData1;
DataGrid1.DataBind();

I have tried a number of things with the different Xml
components such as the Xmlreader and Xmltextreader. I
can't seem to find the correct way to convert the string
into something useful, believe it or not binding to the
text actually returns each character as an item. All the
examples I have found use files as the source, and of
course when I search google for Convert string to xml all
the results are converting Xml to a string.

Nov 12 '05 #1
1 7369
Have you tried:

using System.Data;
using System.IO;

DataSet ds = New DataSet
ds.ReadXml( New StringReader( oList.Fields.GetField
("Status").SchemaXml.ToString() ) );

DataGrid1.DataSource = ds;

--
HTH
Christoph Schittko [MVP]
Software Architect, .NET Mentor
"Braden" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
I am trying to take a string and convert it to a data
source. The string is Xml that I am pulling out of
sharepoint and looks like this:

<Field FromBaseType="TRUE" Type="Choice" Name="Status"
ColName="nvarchar1" DisplayName="Status">
<CHOICES>
<CHOICE>Active</CHOICE>
<CHOICE>Resolved</CHOICE>
<CHOICE>Closed</CHOICE>
</CHOICES>
<Default>Active</Default></Field>

This is about all I have come up with but of course it
doesn't work:
String xmlData1 = oList.Fields.GetField
("Status").SchemaXml.ToString();

DataGrid1.DataSource = xmlData1;
DataGrid1.DataBind();

I have tried a number of things with the different Xml
components such as the Xmlreader and Xmltextreader. I
can't seem to find the correct way to convert the string
into something useful, believe it or not binding to the
text actually returns each character as an item. All the
examples I have found use files as the source, and of
course when I search google for Convert string to xml all
the results are converting Xml to a string.

Nov 12 '05 #2

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

Similar topics

1
by: Yuriy | last post by:
Hi, Can anybody explain the following? Say I have the following source XML and XSLT (see below). No matter what this XSLT does. It is just a sample to show a problem. the idea is that XSLT...
18
by: Steve Litvack | last post by:
Hello, I have built an XMLDocument object instance and I get the following string when I examine the InnerXml property: <?xml version=\"1.0\"?><ROOT><UserData UserID=\"2282\"><Tag1...
0
by: William Stacey [MVP] | last post by:
Had a method that got some string info from mp3 tags in N files and serializes this class and deserializes at other side. Works ok except sometimes get chars that choke the XmlSerializer. After...
5
by: feng | last post by:
OK, all I want is writting a string that represents an XML document into a file, say C:\test.xml. This kind of task used to be so easy with vb6. But now, with VB.Net, it seems turned into a big...
4
by: John Smith | last post by:
How can I allow someone to cast my C# class into System.String? Is it possible in C#? In C++ I used "operator" keyword to mark C++ member function.
4
by: Trapulo | last post by:
I've a webservice with a string parameter. I call this webservice passing a string that is 1129 chars length. On the webservice, the received string is 1146 length (I tested sizes with...
1
by: shapper | last post by:
Hello, I am having 2 problems related with strings: 1. I have a string as follows: "File01.xml,File02.xml,File03.xml" I need to create an array where first item is "File01.xml", second item...
0
by: =?Utf-8?B?Y2luZHk=?= | last post by:
I know I wrote before a week ago when I knew even less than now but I am getting better please anyone give me a clue or an example. Am I completely off track? I have a datarow in a table with the...
13
by: xzzy | last post by:
None of the following properly do the VB.net double quote conversion because all of the following in csharp convert to \" instead of just a double quote: " I have tried: char...
2
by: =?Utf-8?B?Q29kZVJhem9y?= | last post by:
Is there a snazzy linq way (or failing that, just a .net 2 way) of testing whether an xml string is well-formed xml. I have an xml string which is created on the fly. I am encoding illegal xml...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.