Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / OpenAccess ORM > Telerik Data Services Wizard > NVarchar(max) get limited to string[255] in WCF Ria Domain Service

Not answered NVarchar(max) get limited to string[255] in WCF Ria Domain Service

Feed from this thread
  • Jörg avatar

    Posted on Oct 26, 2011 (permalink)

    I use the OpenAccess tool for my web application. The Designer corretly imports the data from sql server and creates a "CLOB" type for my memo fields. Everything works perfect.

    Now I have added a Silverlight widget that uses WCF Ria Services to access the data and basically it works.
    However I have noticed that the generated code in the Silverlight project shows a limitation of 255 characters for all the memo fields which is a problem.
    The problem is that updates do not work for entities, even when the relavant columns have not been changed, I immediately get a verification error back.

    Is this a know issue in the code generator?

    Any help is appreciated
    Joerg

    Reply

  • Petar Petar admin's avatar

    Posted on Oct 31, 2011 (permalink)

    Hello Jörg ,

     We haven't had such issue reported up until now. Can you please share with me the exact version of OpenAccess you are using. The reason I am asking you this is because in versions prior to Q2 we had a problem where our internal concurrency mechanism was interfering with the one used by RIA and that caused all updates to fail.
    In order to test this can you please turn off our concurrency mechanism for the class with which you are testing and see if that fixes your problem?

    All the best,
    Petar
    the Telerik team

    NEW and UPDATED OpenAccess ORM Resources. Check them out!

    Reply

  • Jörg avatar

    Posted on Oct 31, 2011 (permalink)

    Hi Petar

    I am using the newest version (Telerik.Open.Access 2011.2.713.3).
    Here the detailed info through the various layers (including a screen shot for every item in the list).

    - On the SQL Server database I have a user defined data type called MemoText defined as nvarchar(max)
    - On various tables I use this datatype, for example the column "ActualStatus"
    - In the ORM designer the column is modeled as a string
    - In the XML definition of the rlinq file the column ActualStatus is shown with length 0 and ado-type CLOB which is correct.
    - On the server side I created a DomainService, but there is nothing special to see
    - In the Silverlight project the generated code for the columns which are modeled with nvarchar(max) (or to be more precise the ones with the user defined data type have a max length of 255 chars.

    Hope with this information you will be able to reproduce the error.

    Regards
    Jörg

    Reply

  • Petar Petar admin's avatar

    Posted on Nov 3, 2011 (permalink)

    Hello Jörg ,

     I have tried the same and I can confirm that the string is not trimmed. I haven't done any additional settings nor have I written any code to handle the string. Is it possible that you have a limitation somewhere in your model that causes the trimming? 
    If you are willing I will create a sample project for you so that you can test on your side and see if it fails.

    Best wishes,
    Petar
    the Telerik team

    NEW and UPDATED OpenAccess ORM Resources. Check them out!

    Reply

  • Jörg avatar

    Posted on Nov 8, 2011 (permalink)

    Hi Petar

    I created a small solution that proves my previous statements. Nvarchar(max) get trimmed to string(255) in the generated code file of the Silverlight application. Here the related code snippet of the generated file:

              /// <summary>
           /// Gets or sets the 'Description' value.
           /// </summary>
           [ConcurrencyCheck()]
           [DataMember()]
           [RoundtripOriginal()]
           [StringLength(255)]
           public string Description
           {
               get
               {
                   return this._description;
               }
               set
               {
                   if ((this._description != value))
                   {
                       this.OnDescriptionChanging(value);
                       this.RaiseDataMemberChanging("Description");
                       this.ValidateProperty("Description", value);
                       this._description = value;
                       this.RaiseDataMemberChanged("Description");
                       this.OnDescriptionChanged();
                   }
               }
           }

    I tried to attach the project as a Zip but it is not possible anymore.
    Can I send you the project as a ZIP file by mail?
    Can you please look into this?

    Regards
    Jörg

    Reply

  • Petar Petar admin's avatar

    Posted on Nov 14, 2011 (permalink)

    Hi Jörg ,

    First of all, let me apologize for the late answer.
    Using absolutely the same setup I ended up with this code being generated:

    /// <summary>
            /// Gets or sets the 'Description' value.
            /// </summary>
            [ConcurrencyCheck()]
            [DataMember()]
            [RoundtripOriginal()]
            public string Description
            {
                get
                {
                    return this._description;
                }
                set
                {
                    if ((this._description != value))
                    {
                        this.OnDescriptionChanging(value);
                        this.RaiseDataMemberChanging("Description");
                        this.ValidateProperty("Description", value);
                        this._description = value;
                        this.RaiseDataMemberChanged("Description");
                        this.OnDescriptionChanged();
                    }
                }
            }
    Can you please confirm that you have not decorated your model properties with some additional attributes? Also can you please share with me if you are using xml mapping or attribute one?

    Regards,
    Petar
    the Telerik team

    NEW and UPDATED OpenAccess ORM Resources. Check them out!

    Reply

  • Jörg avatar

    Posted on Nov 17, 2011 (permalink)

    Hi Petar

    Yes I can confirm that I did not add any manual attributes or the like. But maybe our setup is not 100% the same?
    I have prepared a demo project that you can download from http://www.evelix.ch/Software/RiaMemoDemoSample.zip 
    This demo also contains a sql script to create the database.

    Can you see any differences to your project? Does it work at your side without the string limitations?

    Regards
    Jörg 

    Reply

  • Petar Petar admin's avatar

    Posted on Nov 22, 2011 (permalink)

    Hi Jörg ,

     I am sorry for the late replay but we have been busy with the release. I will download your project and your database today and write back as soon as I am able to locate the problem. Thank you for the detailed information you have provided.

    Regards,
    Petar
    the Telerik team

    NEW and UPDATED OpenAccess ORM Resources. Check them out!

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / OpenAccess ORM > Telerik Data Services Wizard > NVarchar(max) get limited to string[255] in WCF Ria Domain Service
Related resources for "NVarchar(max) get limited to string[255] in WCF Ria Domain Service"

OpenAccess ORM Features  |  Documentation  |  Demos  |  Telerik TV  |  Step-by-step Tutorial   ]