我想用linq查询xml的一些信息,但是我得到这样的错误 - 是的,我已经定义 - 使用System.Linq 你能告诉我,问题在哪里? 感谢用linq查询xml
错误1找不到一个 实现查询模式 的源类型 “urn.P.IEEE.Item1671.Item2.Item2008.Item02.InstrumentDescription.InstrumentDescription”。 '找不到'。 d:\ Documents和 设置\ e539951 \我的文档\ Visual 工作室 2010 \项目\ WindowsFormsApplication1 \ WindowsFormsApplication1 \ Form1.cs中28 36 WindowsFormsApplication1
InstrumentDescription test = InstrumentDescription.Load(openFileDialog1.FileName);
var query = from b in test
select new { b.Identification };
看起来更像是使用linq查询对象,什么是'InstrumentDescription',它不是'XDocument'? – Jodrell 2011-05-27 16:30:57
是InstrumentDescription IQueryable? – Jason 2011-05-27 16:33:32
InstrumentDescription是用linqtoxsd生成的.cv文件,然后用xsd生成代码 – 2011-05-27 16:36:00