Link to home
Create AccountLog in
Avatar of BOIT
BOITFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Why does string passed to web service in ASP.NET lose carriage return charcters?

I have a web site written in VB ASP.NET that is consuming a web service on another computer over the internet that I have also writeen in VB ASP.NET. The consuming page sends a string to a service subroutine and the string contains chr(13) & chr(10) sequences to form line breaks in a customer address. The service then calls a SQL stored procedure passing the string. The database only ends up with a char(10) the char(13) being lost somehow.

As a test I created a test service that created a customer record using the same method but created its own test address (i.e. not passed over internet) but using the same stored procedure and same calling routine and the database got both the char(10) and the char(13).

How do I avoid the char(13) being lost when the string is passed to the web service?
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

probably because those characters have no representation in HTML. Replace them with <BR>
Avatar of BOIT

ASKER

No, this is not the problem. The resultant database is being viewed and manipulated by Access not on a web page. The web page is creating the data not viewing it.
ASKER CERTIFIED SOLUTION
Avatar of Chrisedebo
Chrisedebo

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of BOIT

ASKER

Thanks for the suggestion. I am back on this project in about a week and I will check your suggestion then and get back to you.
Avatar of BOIT

ASKER

Chrisedebo exactly right the chr(13) seems to be being stripped in the XML.
I inserted code in the web service:

address = replace(address,chr(10),vbcrlf) and then send data to database and all is well.

Thank you for your help.