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?
BOITAsked:
Who is Participating?
 
ChrisedeboConnect With a Mentor Commented:
Web services use XML to transfer data back and forth. The issue could be here. My advice is to check for and add if necessary the chr(13) in the web service after the data has been received but before it's been stored to the db.
0
 
Éric MoreauSenior .Net ConsultantCommented:
probably because those characters have no representation in HTML. Replace them with <BR>
0
 
BOITAuthor Commented:
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.
0
 
BOITAuthor Commented:
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.
0
 
BOITAuthor Commented:
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.

0
All Courses

From novice to tech pro — start learning today.