locked
'DataServiceQuery' does not exist in 'System.Data.Services.Client' RRS feed

  • Question

  • environment: W7 Ult 64, vs2010 express, Vs2010 express WP

    what am I doing wrong?

    below code (namespace addressDBmodel) has been generated by DataSvcUtil.exe. The official MS doc shows that the 'System.Data.Services.Client Namespace'
     includes the  class'DataServiceQuery'. 

    My version of System.Data.Services.Client (as reference) is:  4.0.0.0 Data modified Oct. 10 2010

    Again; what I'm missing here ?
    Thanks for your time and help
    ed

    error message:
    The type or namespace name 'DataServiceQuery' does not exist in the namespace 'System.Data.Services.Client'
    (are you missing an assembly reference?) 

    //------------------------------------------------------------------------------
    // <auto-generated>
    //     This code was generated by a tool.
    //     Runtime Version:4.0.30319.1
    //
    //     Changes to this file may cause incorrect behavior and will be lost if
    //     the code is regenerated.
    // </auto-generated>
    //------------------------------------------------------------------------------

    // Original file name: lesen.cs
    // Generation date: 28-11-2010 08:31:13
    namespace addressDBmodel
    {
       
        /// <summary>
        /// There are no comments for addressDBentities in the schema.
        /// </summary>
        public partial class addressDBentities : global::System.Data.Services.Client.DataServiceContext
        {
            /// <summary>
            /// Initialize a new addressDBentities object.
            /// </summary>
            [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")]
            public addressDBentities(global::System.Uri serviceRoot) :
                    base(serviceRoot)
            {
                this.OnContextCreated();
            }
            partial void OnContextCreated();
            /// <summary>
            /// There are no comments for addresses in the schema.
            /// </summary>
            [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")]
          
            public global::System.Data.Services.Client.DataServiceQuery<address> addresses              <====== error
            {
                get
                {
                    if ((this._addresses == null))
                    {
                        this._addresses = base.CreateQuery<address>("addresses");
                    }
                    return this._addresses;
                }
            }
            [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")]
            private global::System.Data.Services.Client.DataServiceQuery<address> _addresses;           <======= error
            /// <summary>
            /// There are no comments for addresses in the schema.
            /// </summary>
            [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")]
            public void AddToaddresses(address address)
            {
                base.AddObject("addresses", address);
            }
        }

    ............. etc etc

    Wednesday, December 1, 2010 11:05 AM

Answers

All replies

  • Not everything in C# is supported by the C# Compact Framework. I would guess you've found one of those things. You could try the Windows Phone 7 forum to be certain.
    http://forums.create.msdn.com/forums/98.aspx

     

    -PaulH

    Wednesday, December 1, 2010 3:11 PM
  • Hi,

    OData v2 was released last week (Read the announcement here). Chris Koenig has a very nice post summarizing the changes in his blog post here. You need to download the latest OData client library from Codeplex, specifically this revision. Chris Koenig's tutorial should point you to the right direction. Always remember to add a reference to the OData client assembly.

    FYI:

    http://stackoverflow.com/questions/4064909/odata-on-windows-phone-7

    Thanks

    Binze


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by edkaufmann Friday, December 3, 2010 8:08 AM
    Friday, December 3, 2010 6:30 AM
  • Hi Binze, thanks for your time

    after checking your recommendation I figured that when, originally,  installing the correct oData modules they have not been installed in the C:\....\v4.0.30319 library!
    Therefore, the DataSVCutil generated on the OLD System.Data.Services.dll (and .design).

    With the new one the code looks surely different and I do NOT have that error anymore.

    I will close this thread and again thanks for all your time spent

    ed

    Friday, December 3, 2010 8:09 AM