Trying to store XML content into SQL Server 2005 fails (encoding problem)
I think you can replace the line
Could you possibly re-write the xml as unicode (perhaps to a
MemoryStream) and send that? Note: if you are just storing the data, you can use
varbinary(max) (and it will actually be quicker). This has no encoding difficulties, and will also allow you to audit any corrupt xml that you receive.
If you are querying the data as xml inside the database server then
xml is obviously the way to go.