@ Symbol within XML Schema
-
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 = "Pal0066Printer1TomUser" strXML &= "CanteenBillingEmailPDF" strXML &= "email@problemishere.co.uk" strXML &= "1" 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
-
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 = "Pal0066Printer1TomUser" strXML &= "CanteenBillingEmailPDF" strXML &= "email@problemishere.co.uk" strXML &= "1" 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
tomkettering wrote:
the XML the dataset does not create correctly?
"does not create correctly" means what? The following C# produces the email address as expected.
string sxml = "<root><mail>hello@mymail.com</mail></root>";
DataSet ds = new DataSet();
ds.ReadXml(new System.IO.StringReader(sxml));
Console.WriteLine(ds.Tables[0].Rows[0].ItemArray[0].ToString());led mike
-
tomkettering wrote:
the XML the dataset does not create correctly?
"does not create correctly" means what? The following C# produces the email address as expected.
string sxml = "<root><mail>hello@mymail.com</mail></root>";
DataSet ds = new DataSet();
ds.ReadXml(new System.IO.StringReader(sxml));
Console.WriteLine(ds.Tables[0].Rows[0].ItemArray[0].ToString());led mike
Thanks for your help.