[Model first] How can I change field length of String type property?

6 posts, 0 answers
  1. PT
    PT avatar
    2 posts
    Member since:
    Sep 2011

    Posted 10 Feb 2012 Link to this post

    Hi,
    I'm working with trial version. I'm creating tables with model first approach.
    When I try to create database with "UPdate Database from Model" wizard, the script shows that all string type properties are generated as 255 length varchar for MS SQL Server.  Is there a way to change the length of each string type field to the appropriate length?
  2. Ady
    Admin
    Ady avatar
    588 posts

    Posted 10 Feb 2012 Link to this post

    Hi Kim,

     Once you have clicked 'Map to table' and created the table you need to press the 'OK' button to close the dialog. You should then select the class ,right click on it and select 'Edit table'. You can then select individual columns and change their length.
    We will improve the usability for this soon.

    Kind regards,
    Ady
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Patrick
    Patrick avatar
    1 posts
    Member since:
    Jan 2013

    Posted 29 Aug 2013 Link to this post

    Hi Ady,

    What about if you use model first, no table mappings (auto) and you want to change some string fields in the mapped database to a larger string field eg. varchar(max). How can I do that.

    I 'm not using static tablemappings but a dynamic model first approach. The database is updated automatically.

    Regards,

    Patrick Glaudemans
  5. Ady
    Admin
    Ady avatar
    588 posts

    Posted 02 Sep 2013 Link to this post

    Hi Kim,

     The described steps will work for the 'Model first' approach also. You first need to map a type to a table by clicking the 'Map to Table' menu entry.
    Are the mentioned steps not working for you? 

    Regards,
    Ady
    Telerik
    OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
  6. Phil
    Phil avatar
    84 posts
    Member since:
    Apr 2005

    Posted 09 Feb 2014 Link to this post

    Thanks for this info.

    I think perhaps that option isn't available until you have updated a database, but I could be wrong. Also confusingly varchar(max) is apparently a different SQL type to varchar - pedantic, but its not.

    More importantly for those with visual impairment that dialog is unusable if you have increased Windows font sizes. At 150% font sizing the size controls all but disappear off the bottom of the dialog.
  7. Ady
    Admin
    Ady avatar
    588 posts

    Posted 12 Feb 2014 Link to this post

    Hello Phillip,

     As mentioned earlier the option to modify the default column length is available after a type is mapped to a table. The database need to not be updated.
    Regarding the visual problem, I will ask our QA to look into it.

    Do get back in case you need further assistance.

    Regards,
    Ady
    Telerik
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
Back to Top
DevCraft banner