Tag: 人口普查

Census Geocoder JSON输出在C#中使用JSON.net转换为Xml数据集

我在Visual Studio 2012中创建一个.Net应用程序,用于查询我的SQL dB中的地址表,并使用Census Geocoding API返回每个地址的特定MSA。 我有现有的dB查询代码,但我在将Census API的Json输出转换为Xml数据集时遇到问题。 我正在使用Json.net序列化json输出,然后反序列化为.net以加载到XmlDocument中。 不幸的是,我一直收到XmlException错误: 根级别的数据无效。 第1行,第1位 细节: System.Xml.XmlException未处理HResult = -2146232000 消息=根级别的数据无效。 第1行,第1位。 Source = System.Xml LineNumber = 1 LinePosition = 1 SourceUri =“” StackTrace:位于System.Xml.Xml.Xml.Xh处的System.Xml.XmlTextReaderImpl.Throw(String res,String arg)的System.Xml.XmlTextReaderImpl.Throw(Exception e),位于System.Xml.XmlTextRemplImpl.ParseDocumentContent()的System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()处位于System.Xml.XmlDocument.LoadXml(String xml)的System.Xml.XmlDocument.Load(XmlReader reader)的System.Xml.XmlLoader.Load(XmlDocument doc,XmlReader reader,Boolean preserveWhitespace)中的System.Xml.XmlTextReaderImpl.Read() )在C:\ Users \ jdsmith \ Documents \ Visual Studio 2012 \ Projects \ C#\ MSA_Application_v2 \ MSA_Application_v2 […]