0

There is a old application that I have added some new code/methods and it talks to a SQL Server 2000 database. I have made some changes and compiled it with .Netv4.5 without changing any old methods. New methods required new version of .net

In an old method in the application, it inserts some XML data into a TEXT type column in a table. it was fine before I compiled it with new version but now it appends '?' char in the beginning of the XML string. for e.g. if the string was starting with

<?xml version="1.0" encoding="utf-8"?>

it will insert

?<?xml version="1.0" encoding="utf-8"?>

which is causing issues when reading the XML from the db table.

I have looked around a bit, I initially thought that it was oledb that is causing the issue (don't know much about oledb), but I have tried LINQ without any luck.

I have checked the command before it hits the database, the data was fine but on the profiler the insert command is executed with the extra '?' char

Any quick tip to fix it is appreciated.

2
  • Could it be that some intermediate API (DB, XML, ...) used to strip the BOM and now it doesn't? Since the BOM is non-printable it could be replaced or displayed as a question mark without being an actual one. Commented Feb 15, 2018 at 3:47
  • 1
    It could possibly be something like BOM but I want to fix it before i go away this weekend... it gives me goosebumps... I am not sure what intermediate API may be doing this but oledb command executing a stored proc and the LINQ command is just an insert with new object, both have the same result... Commented Feb 15, 2018 at 4:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.