locked
Problem with & RRS feed

  • Question

  • Hai

           Iam using asp.net 2.0 with sql server 2005 as back end..

    i need to pass the data to stored procedure via parameter containg (&) symbol

    for ex:

     If i pass string like "sample&ss"

    it gives the error xml parsing how to avoid this..welcome for your suggestion.

     

    Regards

    Senthil

     

    Wednesday, October 11, 2006 2:08 PM

Answers

  • If the error is in parsing XML try this: "sample&ss"

    '&' is a special character in XML, and if you catually want to use it you need to represent it as &

    Monday, October 16, 2006 7:09 PM

All replies

  • hi,

    ampersand doesn't seems to cause an error on Sql server as the statement below

    executes succesfully

    select 'sample&ss'

    I think the error happens in dot net since

    where & is an operator such as

    a$='xxx'&'yyy'

    regards,

    joey

    Wednesday, October 11, 2006 4:23 PM
  • If the error is in parsing XML try this: "sample&ss"

    '&' is a special character in XML, and if you catually want to use it you need to represent it as &

    Monday, October 16, 2006 7:09 PM
  • Or...use ASCII...it works all the time Smile
    Tuesday, October 17, 2006 12:32 PM