Copied to clipboard

Flag this post as spam?

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


  • Jess Bonde 25 posts 55 karma points
    May 23, 2012 @ 09:38
    Jess Bonde
    0

    uComponents xPath checkboxlist - String or binary data would be truncated

    I hope this is the right place to ask.
    I have a uComponents xPath checkboxlist that gives me an error when i check 19 or more checkboxes.
    Up until then it saves fine.

    I guess the database field is set to only hold a certain amount of characters and it gives me this error when the string exceeds this length.

    Do I need to change the datatype in the database and how do I do this?
    Any other suggestions?

    The complete error is below:

    Server Error in '/' Application.

    String or binary data would be truncated.
    The statement has been terminated.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: String or binary data would be truncated.
    The statement has been terminated.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [SqlException (0x80131904): String or binary data would be truncated.
    The statement has been terminated.]
       System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +404
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412
       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1363
       System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6387805
       System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +6389506
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +538
       System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +689
       System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +327
       Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +167
       umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +150
    
    [SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery]
       umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +261
       umbraco.cms.businesslogic.datatype.DefaultData.set_Value(Object value) +1229
       uComponents.Core.DataTypes.XPathCheckBoxList.XPathCheckBoxListDataEditor.Save() +561
       umbraco.controls.ContentControl.saveClick(Object Sender, ImageClickEventArgs e) +185
       umbraco.controls.ContentControl.savePublish(Object Sender, ImageClickEventArgs e) +24
       System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +187
       System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +165
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707
    
  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    May 23, 2012 @ 17:30
    Lee Kelleher
    1

    Hi Jess,

    Which version of uComponents are you using?

    Prior to v3.0, we used Nvarchar for the data-type, which we found out there was a limited number of characters - so if you are using XML format, then those characters run out fast!

    We fixed this in v3.0, but there's a catch, if you swap between Nvarchar and Ntext, the content/data will not be swapped over, so you'd need to re-input your content.

    If you are comfortable with SQL queries, I do have a way to move your existing data over from the Nvarchar column to Ntext, see this topic: http://our.umbraco.org/forum/using/ui-questions/21702-Switch-dbType-from-Nvarchar-to-Ntext-without-data-loss

    Cheers, Lee.

  • Jess Bonde 25 posts 55 karma points
    May 24, 2012 @ 11:24
    Jess Bonde
    0

    Thanks Lee.
    I just installed v. 3.0 and it created another instance of uComponents.
    Will I need to create all my custom datatypes again?

    or

    Where do I swap to Ntext and still use v. 2.1?

    /J

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    May 24, 2012 @ 11:32
    Lee Kelleher
    0

    Hi Jess,

    No need to re-create the data-types. The upgraded uComponents will be used in your existing data-types.

    The only side-effect of upgrading packages (and this applies to all Umbraco packages, not just uComponents), is that in the "Installed Packages" menu, you'll see duplicates. :-$

    Cheers, Lee.

  • Jess Bonde 25 posts 55 karma points
    May 24, 2012 @ 14:17
    Jess Bonde
    0

    But I still get the error when trying to save my xPath checkboxlist.
    /J

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    May 24, 2012 @ 14:21
    Lee Kelleher
    0

    Hi Jess,

    Just double-checking, in the settings for the data-type, have you set the "Database Type" dropdown to use "Ntext"?

    Thanks, Lee.

  • Jess Bonde 25 posts 55 karma points
    May 24, 2012 @ 14:51
    Jess Bonde
    0

    Thanks, that's the one I couldn't find :o)
    I thought it was a setting in some config file or something.
    Thanks alot.

    /J

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    May 24, 2012 @ 15:27
    Lee Kelleher
    0

    Happy to help.

    Cheers, Lee.

Please Sign in or register to post replies

Write your reply to:

Draft