locked
First data service, keys fail in predicate RRS feed

  • Question

  • I just created my first web data service using Astoria, from an existing MS SQL 2005 database.  When I try to access any data using a key, like this:
      http://localhost:1943/zzassets.svc/Users[2]
    I get this server 500 error:
    Code Snippet

    Argument types 'bigint' and 'nvarchar' are incompatible for this operation, near WHERE predicate, line 1, column 70.


    When I access it using an expression in the predicate like this:
      http://localhost:1943/zzassets.svc/Users[Name eq Joe]

    it succeeds.  Any ideas why I'm seeing this behavior?

    -- Andy
    Friday, May 4, 2007 3:59 PM

Answers

  • Brief followup -- for debugging I changed all my bigint keys to int in the db and it all works as advertised.  I searched around the Entity Framework documentation for any mention of issues with bigint and did not find anything.

    -- Andy
    Friday, May 4, 2007 5:09 PM

All replies

  • Brief followup -- for debugging I changed all my bigint keys to int in the db and it all works as advertised.  I searched around the Entity Framework documentation for any mention of issues with bigint and did not find anything.

    -- Andy
    Friday, May 4, 2007 5:09 PM
  • Thanks for the follow up. I don't know of any issue with this off the top of my head, but I'll dig more into it to see what is going on.

     

    Good luck with your first data service, let me know if you build something cool Smile

     

    Pablo Castro

    Technical Lead

    Microsoft Corporation

    http://blogs.msdn.com/pablo

     

    Saturday, May 5, 2007 1:06 AM
    Moderator