N
needin4mation
Hi, please consider this snippet:
string filename "c:\\inetpub\\wwwroot\\getdirections\\Directions.xml";
XmlDocument doc = new XmlDocument();
doc.Load(filename);
XmlNodeList authorList =
doc.SelectNodes("/NewDataSet/location[locationidID='westside']");
StreamWriter writer = new StreamWriter();
foreach( XmlNode authorNode in authorList )
{
writer.Write( authorNode.OuterXml );
//Response.Write(authorNode.OuterXml);
}
DataSet ds = new DataSet();
ds.ReadXml( writer.ToString() );
CustomerDataGrid.DataSource = ds.Tables["locations"];
CustomerDataGrid.DataBind();
If I use Reponse.Write, this work (not using the datagrid of course).
What I am trying to do is capture that data in the foreach into some
kind of stream or *something* so I can bind it to my dataset. The
query works, the data will return. I just cannot find out how to
assign it to the dataset from a stream.
Thank you for any help.
string filename "c:\\inetpub\\wwwroot\\getdirections\\Directions.xml";
XmlDocument doc = new XmlDocument();
doc.Load(filename);
XmlNodeList authorList =
doc.SelectNodes("/NewDataSet/location[locationidID='westside']");
StreamWriter writer = new StreamWriter();
foreach( XmlNode authorNode in authorList )
{
writer.Write( authorNode.OuterXml );
//Response.Write(authorNode.OuterXml);
}
DataSet ds = new DataSet();
ds.ReadXml( writer.ToString() );
CustomerDataGrid.DataSource = ds.Tables["locations"];
CustomerDataGrid.DataBind();
If I use Reponse.Write, this work (not using the datagrid of course).
What I am trying to do is capture that data in the foreach into some
kind of stream or *something* so I can bind it to my dataset. The
query works, the data will return. I just cannot find out how to
assign it to the dataset from a stream.
Thank you for any help.