Hi all,
Need some assistance figuring out the code that will pass XML data from a webservice into a local database. The code I have written so far grabs the data, however I'm unable to parse and load into database.
Thanks in advance
Need some assistance figuring out the code that will pass XML data from a webservice into a local database. The code I have written so far grabs the data, however I'm unable to parse and load into database.
Thanks in advance
Code:
using System;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using System.Data;
using System.IO;
using System.Text;
using System.Collections;
using System.Data.Sql;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string connectionstring = null;
SqlConnection connection;
SqlCommand command = new SqlCommand();
SqlDataAdapter adapter = new SqlDataAdapter();
DataSet ds = new DataSet();
DataTable dt = new DataTable("WLS_dev");
connectionstring = "Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\Desktop\\var\\dev\\database\\AdventureWorks2008_Data.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";
connection = new SqlConnection(connectionstring);
XmlTextReader reader = new XmlTextReader("[URL unfurl="true"]https://www.xxxx");[/URL]
reader.WhitespaceHandling = WhitespaceHandling.Significant;
XmlDocument xDoc = new XmlDocument();
xDoc.Load(reader);
XmlNodeReader nodeReader = new XmlNodeReader(xDoc);
nodeReader.Close();
ds.ReadXml(nodeReader);
//how do i parse and pass into dbase table?
ds.Tables.Add(dt);
}
}