locked
Table Storage Query containing character '#' RRS feed

  • Question

  • My query contain character "#". The code like below: 

    string name = "1#23";
    from g in context.CreateQuery<TestEntity>("TestEntities")
                     where g.Name == name

    I got a "one of the request inputs is invalid" exception.

    I have read below link:

    http://social.msdn.microsoft.com/Forums/en/windowsazure/thread/69999243-6a97-4edd-92d1-68849fef4e48

    and try to Uri.EscapeDataString(). It works fine in local development when use Uri.EscapeDataString() before passing the value into query.

     But after I published to Azure Platform, I get no result from query. Who can help me?

    Wednesday, January 12, 2011 9:48 AM

Answers

  • "You mean Azure Platform is using .NET4, and my app using .NET3.5 cause this issue?"

    No, I believe it's simply a bug in .NET 3.5.  (The bug is on the client... the # symbol should be escaped but isn't.)

    I don't know of a good way to work around this.  You might be able to encode the # symbol yourself.

    • Marked as answer by Mog Liang Tuesday, January 25, 2011 2:33 AM
    Monday, January 17, 2011 4:12 AM

All replies

  • Hi George,

    Are you using Development Storage for testing? When deployed the project to cloud, did you replace the storage account with real cloud storage account?

    Thanks,


    Mog Liang
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Friday, January 14, 2011 6:19 AM
  • You should use Fiddler to see precisely what is sent to Azure storage. # is a special symbol in a URL.
    Friday, January 14, 2011 9:28 AM
    Answerer
  • My guess: you're using .NET 3.5.  In .NET 4, this works properly.  I think this is a bug in WCF Data Services that was fixed in .NET 4.  I don't know if there's an updated version of the library for .NET 3.5.
    Friday, January 14, 2011 9:47 AM
  • Hi Mog Liang,

    I use real cloud storage account to debug.

    Monday, January 17, 2011 3:53 AM
  • Yes, I use .NET3.5. It is additional operation to end user install .NET4. And cause the size of intaller become bigger when using .NET4.

    You mean Azure Platform is using .NET4, and my app using .NET3.5 cause this issue? If that is so, how can I fix it? Thanks.

    Monday, January 17, 2011 4:07 AM
  • "You mean Azure Platform is using .NET4, and my app using .NET3.5 cause this issue?"

    No, I believe it's simply a bug in .NET 3.5.  (The bug is on the client... the # symbol should be escaped but isn't.)

    I don't know of a good way to work around this.  You might be able to encode the # symbol yourself.

    • Marked as answer by Mog Liang Tuesday, January 25, 2011 2:33 AM
    Monday, January 17, 2011 4:12 AM