我想用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