This is a migrated thread and some comments may be shown as answers.

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

5 Answers 225 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
PT
Top achievements
Rank 1
PT asked on 10 Feb 2012, 12:14 PM
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?

5 Answers, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 10 Feb 2012, 06:03 PM
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 >>
0
Patrick
Top achievements
Rank 1
answered on 29 Aug 2013, 11:03 AM
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
0
Ady
Telerik team
answered on 02 Sep 2013, 03:46 PM
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.
0
Phil
Top achievements
Rank 2
answered on 09 Feb 2014, 11:53 AM
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.
0
Ady
Telerik team
answered on 12 Feb 2014, 08:39 PM
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.
Tags
Design Time (Visual Designer & Tools)
Asked by
PT
Top achievements
Rank 1
Answers by
Ady
Telerik team
Patrick
Top achievements
Rank 1
Phil
Top achievements
Rank 2
Share this question
or