我将如何解析以下内容以获取 sql 消息 .Net SqlClient 数据提供程序?
我正在尝试使用 Linq to xml 来做到这一点,但我运气不佳。xml 是递归的,所以我无法确定消息将出现在什么级别
有任何想法吗?
谢谢
<detail>
<ErrorCode xmlns="http://www.microsoft.com/sql/reportingservices">rsProcessingAborted</ErrorCode>
<HttpStatus xmlns="http://www.microsoft.com/sql/reportingservices">400</HttpStatus>
<Message xmlns="http://www.microsoft.com/sql/reportingservices">An error has occurred during report processing.</Message>
<HelpLink xmlns="http://www.microsoft.com/sql/reportingservices">http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsProcessingAborted&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=10.50.1600.1</HelpLink>
<ProductName xmlns="http://www.microsoft.com/sql/reportingservices">Microsoft SQL Server Reporting Services</ProductName>
<ProductVersion xmlns="http://www.microsoft.com/sql/reportingservices">10.50.1600.1</ProductVersion>
<ProductLocaleId xmlns="http://www.microsoft.com/sql/reportingservices">1033</ProductLocaleId>
<OperatingSystem xmlns="http://www.microsoft.com/sql/reportingservices">OsIndependent</OperatingSystem>
<CountryLocaleId xmlns="http://www.microsoft.com/sql/reportingservices">1033</CountryLocaleId>
<MoreInformation xmlns="http://www.microsoft.com/sql/reportingservices">
<Source>Microsoft.ReportingServices.ProcessingCore</Source>
<Message msrs:ErrorCode="rsProcessingAborted" msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsProcessingAborted&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=10.50.1600.1" xmlns:msrs="http://www.microsoft.com/sql/reportingservices">An error has occurred during report processing.</Message>
<MoreInformation>
<Source>Microsoft.ReportingServices.ProcessingCore</Source>
<Message msrs:ErrorCode="rsErrorReadingNextDataRow" msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsErrorReadingNextDataRow&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=10.50.1600.1" xmlns:msrs="http://www.microsoft.com/sql/reportingservices">Cannot read the next data row for the dataset DD_Inventory.</Message>
<MoreInformation>
<Source>.Net SqlClient Data Provider</Source>
<Message>Conversion failed when converting the nvarchar value 'h' to data type int.</Message>
</MoreInformation>
</MoreInformation>
</MoreInformation>
<Warnings xmlns="http://www.microsoft.com/sql/reportingservices" />
</detail>