Problem passing a modified string contained within a dataset over a web service

E

eazilyled

I have been having a problem when passing a modified string contained
within a dataset over a web service.

The dataset is populated on a server using an ADO.NET data adapter /
SQL Server 2005 database, and then passed over the wire using web
services to a client win forms app. The dataset contains a table
called 'Note', which in turn contains a string column called 'Body'.
The client app can then edit the value of the 'Body' column and send
the dataset back over to the server using web services for the changes
to be committed to the database.

This all works fine, except when the value of the 'Body' column in one
of the rows starts off as "\r\n" , i.e. just a carriage return, and
then gets modified to "\r\nt". So the values on the client side before
being sent to the server are:

dataset.Tables["Note"].Rows[0]["Body", DataRowVersion.Original] = "\r
\n"
dataset.Tables["Note"].Rows[0]["Body", DataRowVersion.Current] = "\r
\nt"

... the values the server gets are

dataset.Tables["Note"].Rows[0]["Body", DataRowVersion.Original] = ""
<- an empty string!
dataset.Tables["Note"].Rows[0]["Body", DataRowVersion.Current] = "\r
\nt"

This causes my data adapter on the server side to throw a
DBConcurrencyException when committing the changes as it thinks the
data in the database has been modified by someone else (my data
adpater is using a SqlCommandBuilder with the ConflictOption set to
CompareAllSearchableValues).

Has anyone else seen problems similar to this? We are using Visual
Studio 2005 with SP1.

Regards,
Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top