C# 使用SQL server 2014在C中保存和检索XML数据#

C# 使用SQL server 2014在C中保存和检索XML数据#,c#,asp.net,xml,xslt,C#,Asp.net,Xml,Xslt,我的XML数据如下所示 <?xml version="1.0" standalone="yes"?> <DocumentElement> <XMLData> <TUReportData><BureauResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <RawData

我的XML数据如下所示

<?xml version="1.0" standalone="yes"?>
<DocumentElement>
<XMLData>
<TUReportData><BureauResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RawData xmlns="https://secure.transunion.co.za/TUBureau" />
<ResponseStatus xmlns="https://secure.transunion.co.za/TUBureau">Success</ResponseStatus>

这是完整的代码,但问题是xml代码,我需要先转换标记,然后再将其传递,以便在保存时对其进行样式设置。xml是经过编码的,因此,当您将其返回时,只需运行即可

 string html = HttpUtility.HtmlDecode(encodedXMLString);

我不知道这里的问题是什么,但我希望这能有所帮助。

你的问题是什么?您的代码正在转换是什么意思?代码在哪里?是否从存储过程接收xml?我通常做的是把这个xml放到一个对象中。我编辑了这个问题,让代码在我上面放的代码中放在哪里?试着从读卡器读到字符串生成器中的每一行。您应该能够执行foreach(reader.ReadLine()中的var line){htmlOutput.Append(line)}或将Results.InnerHtml设置为HttpUtility.Html.Decode(htmlOutput)以便Results.InnerHtml=HttpUtility.HtmlDecode(htmlOutput)。我希望这有帮助。我最近在这个问题上遇到了麻烦。
 string html = HttpUtility.HtmlDecode(encodedXMLString);