Wednesday, March 21, 2012

Problem with &

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

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

|||

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 &

|||Or...use ASCII...it works all the time Smilesql

No comments:

Post a Comment