Link to home
Start Free TrialLog in
Avatar of subhorachana
subhorachana

asked on

Passing & as a parameter in string

Hello,
I have a message in XML format and I am retreiving data from each element of the XML using XPATH in Biztalk.I am now passing this data as parameters where I want to do additional manipulation to the data.
One of my string parameter values is coming as "EK &SONS INC" and when I try to pass this as it is in string format in a method call, I get the following error: "System.Xml.XmlException: An error occurred while parsing EntityName"
I have even tried to replace the & with &
Please suggest what should  I do to format the string such that  the '&' is retained in the string and the method call is successful.
I am using C#.NEt for coding
Avatar of subhorachana
subhorachana

ASKER

it is in c# programming zone.
It was not- I added it there when I posted the above message :)
It was only in Microsoft Development, Programming Languages
Could we see some sample code?

Possibly the full stack trace?
exact location of code where I am getting the error:I am trying to create an XML as one of the parameter for Web service.It throws an error while creating the XML.
batchElement.InnerXml = "<Method ID='1' Cmd='New'>" +
               "<Field Name='Title'>APIS</Field>" +
               "<Field Name='Status'>Pending</Field>" +
              "<Field Name='Number'></Field>" +
              "<Field Name='EffecitveDate'>adsafsa</Field>" +
              "<Field Name='ExpirationDate'></Field>" +
              "<Field Name='Named'>EK &amp;SONS INC</Field>" +
              "<Field Name='NamedICity'>Chicago</Field>" +
              "<Field Name='NamedZIP'>60611</Field></Method>"
ASKER CERTIFIED SOLUTION
Avatar of Tony McCreath
Tony McCreath
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial