using System; using System.Data; using System.Xml; using System.IO; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("d:\\product.xml"); XmlNodeList nodeList = xmlDoc.DocumentElement.SelectNodes("/Table/Product"); string proID = "", proName = "", price=""; foreach (XmlNode node in nodeList) { proID = node.SelectSingleNode("Product_id").InnerText; proName = node.SelectSingleNode("Product_name").InnerText; price = node.SelectSingleNode("Product_price").InnerText; MessageBox.Show(proID + " " + proName + " " + price); } } } }