Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Shada 55 posts 137 karma points
    Sep 04, 2015 @ 12:30
    Shada
    0

    System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated. (MultiNode Tree Picker)

    Hi all, I need to programmatically fill property MultiNode Tree Picker. But when the values ​​too much, I get an error: System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated.

               IContent pl = contentService.GetById(cn.IdPlace);   
               cn.IdProperty = "5776, 5674, 5768, 5777, 6430, 6549, 6400, 6401, 6403, 6404, 6056, 6055, 6171, 5793, 6479, 6133, 6465, 6480, 6057, 6058, 6059, 6063, 6080, 6081, 6082, 6083, 6579, 6117, 6118, 6119, 6120, 6121, 6122, 6123, 6124, 6125, 6126, 6127, 6128, 6129, 6130, 6131, 6132, 6134, 6135, 6136, 6137, 6138, 6139, 6140, 6141, 5927, 5929, 6009, 6007, 6284, 6156, 6582, 6583, 5766, 6457, 6455, 6454, 6365, 6366, 6144, 6145, 6146, 6297, 6281, 6000, 5974, 6002, 6012, 6003, 6005, 6008, 5985, 5991, 5992, 5994, 5995, 5997, 6010, 6016, 5984, 5986, 6310, 5988";
                pl.SetValue("properties", cn.IdProperty);
    

    How do I get around this?

  • Casper Andersen 126 posts 508 karma points
    Sep 05, 2015 @ 14:59
    Casper Andersen
    0

    Easy i think, go to the developer section, then go to datatypes and find the multinode tree picker and set the maximum allowed items up to what your needs may be.

    Hope that works out for you

  • Shada 55 posts 137 karma points
    Sep 05, 2015 @ 19:02
    Shada
    0

    Unfortunately it did not help. I set the maximum allowed items = 100. I have 95 items that I want to add. The error occurs after 80 items. But then I add new entries manually, and there is no error. But since I have to handle a lot of items I can not add them manually.

  • jivan thapa 194 posts 681 karma points
    Sep 06, 2015 @ 05:50
    jivan thapa
    100

    Could you try to change a dbType (field) property from nvarchar to ntext for Umbraco.MultinodeTreePicker on cmsDataType table?

    enter image description here

  • Shada 55 posts 137 karma points
    Sep 07, 2015 @ 07:39
    Shada
    0

    Thank you! It works!

Please Sign in or register to post replies

Write your reply to:

Draft