'Missing Schema Info
I am getting this error message n Visual Studio: "Could not find Schema Information Number, Name, Period, a0 and aJ." I have a working schema "SemiMajorAxis.xsd" but I do not know how to use it. Later in the program I deal with the DataTable
SemiMajorAxis.aspx.cs
DataSet dsread = new DataSet(); DataTable dtread = new DataTable(); dsread.ReadXml(Server.MapPath("SemiMajorAxis.xml")); dtread = dsread.Tables[0]; XDocument xmldoc = XDocument.Load(Server.MapPath("SemiMajorAxis.xml")); var elements = from data in xmldoc.Descendants("planet") select new { Numberp = (int)data.Element("Number"), Namep = (string)data.Element("Name"), Pyrsp = (double)data.Element("Period"), a0p = (double)data.Element("a0"), aJp = (double)data.Element("aJ") }; foreach (var element in elements) { m = m + 1; num[m] = element.Numberp; name[m] = element.Namep; a0[m] = element.a0p; aJ[m] = element.aJp; a[m] = a0[m] + aJ[m] * J; }
SemiMajorAxis.xml
<?xml version="1.0" standalone="yes"?> <planets> <planet> <Number>1</Number> <Name>Mercury</Name> <Period>0.2408</Period> <a0>0.38709893</a0> <aJ>0.00000066</aJ> </planet> <planet> <Number>2</Number> <Name>Venus</Name> <Period>0.6152</Period> <a0>0.72333199</a0> <aJ>0.00000092</aJ> </planet> <planet> <Number>3</Number> <Name>Earth</Name> <Period>1</Period> <a0>1.00000011</a0> <aJ>-0.00000005</aJ> </planet> </planets>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
