你的description是在哪个namespace下定义的?试试这个: XmlDocument xmlLoader = new XmlDocument(); xmlLoader.Load(xmlfilepath); // param is a string XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlLoader.NameTable); nsmgr.AddNamespace("rptdef", @"http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition"); XmlNodeList result = xmlLoader.SelectNodes(@"/Report/Description", nsmgr);
XmlDocument xmlLoader = new XmlDocument();
xmlLoader.Load(xmlfilepath); // param is a string
XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlLoader.NameTable);
nsmgr.AddNamespace("rptdef", @"http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition");
XmlNodeList result = xmlLoader.SelectNodes(@"/Report/Description", nsmgr);