本文介绍了在C#中编写一个更新查询以删除续价,然后将其发送到sql数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的代码.粗体字是我要达到的目标.任何帮助将不胜感激.
Here is my Code. The areas in bold is what I am trying to achieve. Any help would be greatly appreciated.
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();
}
}
}
推荐答案
这篇关于在C#中编写一个更新查询以删除续价,然后将其发送到sql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!