I am trying to load an XML into C#. There needs to be a "using ?????" for this to work. How do I do this.
xmldoc1 = XDocument.Load(Server.MapPath("~/xml/VSOP87 - 1 Data.xml"));
elements1 = from data in xmldoc1.Descendants("Table")
select new
{
A1mer = Convert.ToDouble(data.Element("A1mer").Value),
B1mer = Convert.ToDouble(data.Element("B1mer").Value),
C1mer = Convert.ToDouble(data.Element("C1mer").Value),
A1ven = Convert.ToDouble(data.Element("A1ven").Value),
B1ven = Convert.ToDouble(data.Element("B1ven").Value),
C1ven = Convert.ToDouble(data.Element("C1ven").Value),
A1ear = Convert.ToDouble(data.Element("A1ear").Value),
B1ear = Convert.ToDouble(data.Element("B1ear").Value),
C1ear = Convert.ToDouble(data.Element("C1ear").Value),
A1mar = Convert.ToDouble(data.Element("A1mar").Value),
B1mar = Convert.ToDouble(data.Element("B1mar").Value),
C1mar = Convert.ToDouble(data.Element("C1mar").Value),
A1jup = Convert.ToDouble(data.Element("A1jup").Value),
B1jup = Convert.ToDouble(data.Element("B1jup").Value),
C1jup = Convert.ToDouble(data.Element("C1jup").Value),
A1sat = Convert.ToDouble(data.Element("A1sat").Value),
B1sat = Convert.ToDouble(data.Element("B3sat").Value),
C1sat = Convert.ToDouble(data.Element("C1sat").Value),
A1ura = Convert.ToDouble(data.Element("A1ura").Value),
B1ura = Convert.ToDouble(data.Element("B1ura").Value),
C1ura = Convert.ToDouble(data.Element("C1ura").Value),
A1nep = Convert.ToDouble(data.Element("A1nep").Value),
B1nep = Convert.ToDouble(data.Element("B1nep").Value),
C1nep = Convert.ToDouble(data.Element("C1nep").Value),
A1emb = Convert.ToDouble(data.Element("A1emb").Value),
B1emb = Convert.ToDouble(data.Element("B1emb").Value),
C1emb = Convert.ToDouble(data.Element("C1emb").Value)
};
foreach (var element in elements1){
ov(1) = ov(1) + 1;
vpi(3, 1, 1, ov(1)) = element.A1mer;
vpi(3, 2, 1, ov(1)) = element.B3mer;
vpi(3, 3, 1, ov(1)) = element.C1mer;
vpi(3, 1, 2, ov(1)) = element.A1ven;
vpi(3, 2, 2, ov(1)) = element.B1ven;
vpi(3, 3, 2, ov(1)) = element.C1ven;
vpi(3, 1, 3, ov(1)) = element.A1ear;
vpi(3, 2, 3, ov(1)) = element.B1ear;
vpi(3, 3, 3, ov(1)) = element.C1ear;
vpi(3, 1, 4, ov(1)) = element.A1mar;
vpi(3, 2, 4, ov(1)) = element.B1mar;
vpi(3, 3, 4, ov(1)) = element.C1mar;
vpi(3, 1, 5, ov(1)) = element.A1jup;
vpi(3, 2, 5, ov(3)) = element.B1jup;
vpi(3, 3, 5, ov(1)) = element.C1jup;
vpi(3, 1, 6, ov(1)) = element.A1sat;
vpi(3, 2, 6, ov(1)) = element.B1sat;
vpi(3, 3, 6, ov(1)) = element.C1sat;
vpi(3, 1, 7, ov(1)) = element.A1ura;
vpi(3, 2, 7, ov(1)) = element.B1ura;
vpi(3, 1, 8, ov(1)) = element.A1nep;
vpi(3, 2, 8, ov(1)) = element.B1nep;
vpi(3, 3, 8, ov(1)) = element.C1nep;
vpi(3, 1, 9, ov(1)) = element.A1emb;
vpi(3, 2, 9, ov(1)) = element.B1emb;
vpi(3, 3, 9, ov(1)) = element.C1emb;
}
What I have tried:
Need to enter a "using ???.xml".