Happy New Year,Strange one to start the year off, any help would be appreciated.I have a Winform Project calling a web service.   passing in an XML string.When I pass through my XML to the webservice, it works fine and gets inserted into the dataset without a problem, however as soon as I include an email address within the XML the dataset does not create correctly?Dim strXML As String = "<parameters><parameterline><details><machineid>Pal0066</machineid><printer>Printer1</printer><username>TomUser</username>"strXML &= "<reportname>CanteenBilling</reportname><receiptmethod>Email</receiptmethod><format>PDF</format>"strXML &= "<emailto>[email protected]</emailto><emailcc></emailcc><emailbcc></emailbcc><emailsubject></emailsubject>"strXML &= "<emailbody></emailbody></details><reportparameters><location>1</location></reportparameters></parameterline></parameters>"ConvertXMLIntoDS(StrXML) Private Function ConvertXMLIntoDS(ByVal strXML As String) As Data.DataSet                        Dim ds As New Data.DataSet            Dim reader As System.IO.StringReader            Try                  reader = New System.IO.StringReader(strXML)                  ds.ReadXml(reader)                  ConvertXMLIntoDS = ds            Catch ex As Exception                  ''RunReports.AddLog("ConvertXMLIntoDS - Error")                  ''RunReports.AddError(ex, methodBase.Name)            Finally                  If Not IsNothing(ds) Then                        ds.Dispose()                        ds = Nothing                  End If                  If Not IsNothing(reader) Then                        reader.Dispose()                        reader = Nothing                  End If            End Try               End Function 解决方案 "does not create correctly" means what? The following C# produces the email address as expected.string sxml = "<root><mail>[email protected]</mail></root>";<br />DataSet ds = new DataSet();<br />ds.ReadXml(new System.IO.StringReader(sxml));<br />Console.WriteLine(ds.Tables[0].Rows[0].ItemArray[0].ToString());<br /><br /> 这篇关于XML模式中的@符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-31 07:48