Thursday, February 18, 2010

DataBinding an Arbitrary XML String to an ASP.Net GridViev

DataSet ds = new DataSet();
string xml = GetSomeXMLFromWherever();

ds.ReadXml(new StringReader(xml), XmlReadMode.InferSchema);
GridView1.DataSource = ds;
GridView1.DataBind();

No comments: