paulcc84 said:
want to parse the XML on the C# and insert
normal database type
I'm working with xml at the moment.
Here's a snippet, I've fiddled with it a bit to try and make it clearer what
it does.
I'm inserting into a datatable but you could stick whatever object there or
foreach a list or whatever.
My XML file is as flat as a file you'd ever find.
XDocument xd = XDocument.Load("file.xml");
var q = from c in xd.Descendants("xmlroot")
orderby (Int32)c.Element("ColID")
select c;
DataTable dt = ds.Tables[0];
foreach (var c in q)
{
DataRow row = dt.NewRow();
row["ColID"] = (Int32)c.Element("ColID");
row["FieldName"] = (String)c.Element("FieldName");
row["SeeInGrid"] = (Boolean)c.Element("SeeInGrid");
row["ColOrder"] = (Int32)c.Element("ColOrder");
row["DataType"] = (String)c.Element("DataType");
row["ColHeading"] = (String)c.Element("ColHeading");
row["ColWidth"] = (String)c.Element("ColWidth");
dt.Rows.Add(row);
}