DataTable data_table = new DataTable();
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter("select * from test_table", connection);
da.Fill(ds);
ds.WriteXml(@"c:\output2.xml", XmlWriteMode.IgnoreSchema);
connection.Close();
Read XML file data
XmlTextReader xml_reader = new XmlTextReader(@"c:\output1.xml");
XmlDocument xml_doc = new XmlDocument();
xml_doc.Load(xml_reader);
XmlNode select_node = xml_doc.SelectSingleNode("NewDataSet");
node_list = xml_doc.GetElementsByTagName("Table");
for (i = 0; i < node_list.Count; i++)
{
for (j = 0; j < node_list[i].ChildNodes.Count; j++)
{
Response.Write(node_list[i].ChildNodes[j].InnerText);
}
}
No comments:
Post a Comment