More in this section

Forums / General Discussions / Modifiy Dynamic Data DbType and DBSqlType

Modifiy Dynamic Data DbType and DBSqlType

2 posts, 0 answered
  1. Jmr
    Jmr avatar
    53 posts
    Registered:
    21 Jan 2011
    16 Mar 2011
    Link to this post
    Hi.

    I have created DynamicData following code,now i may want to change  MAX value instead of 255!  using API


     bool changedDB = false;
                            App.WorkWith().DynamicData().Type(typeof(Document))
                               .Field().TryCreateNew("Description", typeof(string), ref changedDB).Done()
                           .SaveChanges(true);


    Thnks
    Jmr
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    22 Mar 2011
    Link to this post
    Hi Jmr,

    You could use the following code:

    bool changedDB = false;
     App.WorkWith().DynamicData().Type(typeof(Document))
        .Field()
         .TryCreateNew("Description11", typeof(string), refchangedDB)
         .Do(
             f =>
             {
                 f.DBType = "LONGVARCHAR";
                 f.DBSqlType = "NAVARCHAR(MAX)";
             })
        .Done()
    .SaveChanges(true);


    Regards,
    Radoslav Georgiev
    the Telerik team
2 posts, 0 answered