Copied to clipboard

Flag this post as spam?

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


  • Jason Espin 368 posts 1335 karma points
    Nov 10, 2014 @ 18:15
    Jason Espin
    0

    System.Data.SqlClient.SqlException : String or binary data would be truncated.

    Hi all,

    I have followed the tutorial below to create a field with a character limit of 200 in my Umbraco installation.

    http://www.nibble.be/?p=285

    I am now trying to import data using the Content Service into this field but I keep getting the following error:

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

    I assumed that this was becuase the content it was trying to enter was over 200 characters so I did the following in my C# code:

    umbraco_node.SetValue("teaser", teaser.Truncate(190));
    

    Here umbraco_node is my Umbraco page. "teaser" is the limited field I mentioned above that has a character limit of 200 as per the code in the Url I have provided. I have set the truncate on the teaser variable (which contains my string of text) to 190 characters and yet the error still persists. How do I get around this? This is a standard Umbraco database setup, I have not touched any of the fields at all so it should not be erroring in this way.

    I am using Umbraco v7.1.8.

    Any help would be greatly appreciated.

Please Sign in or register to post replies

Write your reply to:

Draft