Insert a XML file in SQL server "Database" with C#.net
Know More : ASP.Net VB.Net C#.Net Sliverlight XML WPF WCF Ajax
using System;
using System.Data;
using System.Xml;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
namespace Xml_to_database_insert
{
public partial class Form1 : Form
{
DataTable dt;
DataRow dr;
public Form1()
{
InitializeComponent();
}
private void buttonX1_Click(object sender, EventArgs e)
{
string l = "D:\\RAPL\\RAPLStaff.xml"; // your xml file path.
DataSet dtk = new DataSet();
FileStream fstr = new
FileStream("D:\\RAPL\\RAPLStaff.xml", FileMode.Open,
FileAccess.Read);
dtk.ReadXml(fstr);
// string myfile = "c:\\D.xml";
oleDbDataAdapter1.Update(dtk);
MessageBox.Show("Data loaded");
}
}
}
Know More : ASP.Net VB.Net C#.Net Sliverlight XML WPF WCF Ajax
using System;
using System.Data;
using System.Xml;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
namespace Xml_to_database_insert
{
public partial class Form1 : Form
{
DataTable dt;
DataRow dr;
public Form1()
{
InitializeComponent();
}
private void buttonX1_Click(object sender, EventArgs e)
{
string l = "D:\\RAPL\\RAPLStaff.xml"; // your xml file path.
DataSet dtk = new DataSet();
FileStream fstr = new
FileStream("D:\\RAPL\\RAPLStaff.xml", FileMode.Open,
FileAccess.Read);
dtk.ReadXml(fstr);
// string myfile = "c:\\D.xml";
oleDbDataAdapter1.Update(dtk);
MessageBox.Show("Data loaded");
}
}
}
Know More : ASP.Net VB.Net C#.Net Sliverlight XML WPF WCF Ajax
No comments