Locked "'.', hexadecimal value 0x00, is an invalid character

  • Friday, May 15, 2009 7:42 PM
     
     
    I have a program that calls a method in my web service.  The method executes a stored procedure and then returns a DataTable to my program.  I have used it many times and works just fine except for one stored procedure that I call.  The stored procedure works just fine and fills the DataTable, but when I return my DataTable to my program I get the following error:

    There is an error in XML document

    Inner Exception:

    '.', hexadecimal value 0x00, is an invalid character. Line 1, position 270757.

    Help Please.

All Replies

  • Friday, May 15, 2009 11:11 PM
    Moderator
     
     
    "00" is an invalid character.

    John Saunders
    Use File->New Project to create Web Service Projects
    Use WCF for All New Web Service Development, instead of old ASMX or obsolete WSE
  • Monday, May 18, 2009 6:18 PM
     
     
    I realize that. 0x00 is a null value if I'm not mistaken, but I don't know how to fix it.  Is there some property I can set on my datatable to allow nulls or to I have to go through all the null values in my tables and put data in them?
  • Monday, May 18, 2009 7:18 PM
    Moderator
     
     Answered
    You need to find out where the stored procedure is placing a null, then figure out why.

    It's possible that your stored procedure is returning binary data in a varchar column, which is bad. If so, then that column needs to become varbinary.

    You can't "fix" it without knowing what's wrong.

    John Saunders
    Use File->New Project to create Web Service Projects
    Use WCF for All New Web Service Development, instead of old ASMX or obsolete WSE
    • Marked As Answer by edhickey Tuesday, May 26, 2009 6:56 PM
    •