using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Xml; using System.Data.SqlClient; namespace XMLReader { public partial class XMLReaderControl : Form { //Name of DataGrid public string strTableName = ""; public XMLReaderControl() { //Table file name is Malfunction.xml InitializeComponent(); strTableName = "Malfunction"; TableDisplay.Text = strTableName; } private void btnReader_Click(object sender, EventArgs e) { string strFilePath = ""; string strOutput = ""; // Read XML data into a DataSet DataSet ds = new DataSet("ds"); //Path to the XML file strFilePath = @"C:\Users\jeremyn\Desktop\Programs\XMLReader\Malfunction.xml"; ds.ReadXml(strFilePath); //dataGridView1.DataSource = ds; TableDisplay.DataSource = ds.Tables[strTableName]; // Read a DataSet into an XML document System.Xml.XmlDataDocument xmlDataDoc = new XmlDataDocument(ds); // trying to find an alternet for the XMLDataDocument. strOutput = xmlDataDoc.InnerXml; XMLDisplay.Text = strOutput; } private void btnConvert_Click(object sender, EventArgs e) { /* When this button is clicked I want it to update the xml so that it changes the carrage returns, within all the rows, shows the change within the text view box, and then brings up a window with the option to submit to an sql database.*/ } private void btnExit_Click(object sender, EventArgs e) { Application.Exit(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)