Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP.NET (Non-Forum Related)
 Arrgghhh!! DataSet and Strings
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Azaniah
Senior Member

United Kingdom
1004 Posts

Posted - 09 December 2003 :  08:31:42  Show Profile  Visit Azaniah's Homepage
Can anyone help me?

I need to import a string into a DataSet. The string is infact an XML Document (but in string format - dont' ask it's the way the stupid system works). I know you can import XML to a DataSet but I need to do the same thing with the string.

I've played with XmlReader ReadString but I'm getting no where..

Anyone got any ideas?

Cheers Az

Eagles fly!, but weasels don't get sucked into jet engines.

Azaniah
Senior Member

United Kingdom
1004 Posts

Posted - 09 December 2003 :  12:12:42  Show Profile  Visit Azaniah's Homepage
I "think" I've sorted it..

StringReader myStream;
XmlTextReader reader = null;
myStream = new StringReader(results);
reader = new XmlTextReader(myStream);
DataSet myDataSet = new DataSet();
myDataSet.ReadXml(reader);
DataView myDataView = new DataView(myDataSet.Tables["row"]);
DataGrid1.DataSource=myDataView;
DataGrid1.DataBind();

Appears to do roughly the right thing.
If anyone knows a more compact way to achieve this - I'd appreciatte knowing.

Eagles fly!, but weasels don't get sucked into jet engines.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000 Version 3.4.07