Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bind XML Fragment to dropdownlist 1

Status
Not open for further replies.

crazyboybert

Programmer
Jun 27, 2001
798
GB
Hi All

I have object which returns a fragment of XML as a string in the form...
Code:
<datasets>
<dataset>
<data/>
<data/>
</dataset>
<dataset>
<data/>
<data/>
</dataset>
</datasets>
I would like to use this fragment of XML to bind to an asp:dropdownlist. I have been trying to create an XML document that only exists in memory, populate it with my fragment, bind to the control and then bin it without the XML document ever existing outside of memory. I dont really want to have an actual file which i read and write the XML from but will if I have to..

Any ideas on how to achieve this binding wether it be via the above method or not would be greatly appreciated.

Thanks in advance

Rob

------------------------------------

Go placidly amidst the noise and haste,
find what peace there may be in silence.
-Anon

------------------------------------
 
You could fill a dataset with the xml, and then use the dataset to bind to the drop down list.

D'Arcy
 
Yeah thats kind of what I was thinking of doing....

The problem is not the theory but the practice of converting a STRING of xml to an XML document i can use to fill the dataset. I'm aware of the XmlWriter, XmlReader, XmlFragment etc classes but have been having real trouble getting my string containin an xml fragment into a XML Document with which to fill the dataset.

I would like this all to happen in memory i.e. the XML file never 'physically' exists. I'm pretty new to .NET and have been struggling with the textwriter, streamreader, xmlwriter methods...

Any help appreciated - Thanks

Rob

------------------------------------

Go placidly amidst the noise and haste,
find what peace there may be in silence.
-Anon

------------------------------------
 
I'm pretty sure that the dataset has a method to fill via xml, which can take either a document OR a string (could be wrong, and dont' have vs.net here at work...sigh).

Check into that first before trying to figure out how to fill the xml file. I'm fairly certain the dataset will take xml in either format.

D'Arcy
 
Thanks D'Arcy

Thats just the sort of thing im looking for...

:)



------------------------------------

Go placidly amidst the noise and haste,
find what peace there may be in silence.
-Anon

------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top