in

CodeSmith Community

Your Code. Your Way. Faster!

Problem with ntext

Last post 04-12-2007 3:45 PM by Norsten. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 03-13-2007 6:12 AM

    • geochatz
    • Top 500 Contributor
    • Joined on 09-18-2006
    • Piraeus, Greece
    • Posts 13
    • Points 365

    Problem with ntext

    There is an issue, that was created during the last nightly build (2007/03/12), that a ntext field in the database can hold only 16 bytes. So if you have a ntext field and you try to save the object in the database you will get an error.

     Error :
    "DocumentBody can not exceed 16 characters" 

     "DocumentBody" is the field Name.
     

    Sex is like programming; one mistake and you must support it forever...
    Filed under: ,
    • Post Points: 65
  • 03-13-2007 8:44 AM In reply to

    Re: Problem with ntext

    What version of CodeSmith are you using?

    On 3/13/07, geochatz wrote:
    >
    >
    > There is an issue, that was created during the last nightly builds, that a
    > ntext field in the database can hold only 16 bytes. So if you have a ntext
    > field and you try to save the object in the database you will get an error.
    >
    > Error :
    > "DocumentBody can not exceed 16 characters"
    >
    > "DocumentBody" is the field Name.
    >
    >
    >
    >

    Robert Hinojosa

    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams

    http://www.nettiers.com
    -------------------------------------
    • Post Points: 35
  • 03-13-2007 8:47 AM In reply to

    • geochatz
    • Top 500 Contributor
    • Joined on 09-18-2006
    • Piraeus, Greece
    • Posts 13
    • Points 365

    Re: Problem with ntext

    I am using 4.0.0 Rev 1724 , but with the previous nightly build (2007/03/08) there was no problem!!
    Sex is like programming; one mistake and you must support it forever...
    • Post Points: 5
  • 03-19-2007 9:14 AM In reply to

    • Norsten
    • Top 500 Contributor
    • Joined on 02-19-2007
    • Posts 14
    • Points 275

    Re: Problem with ntext

    Hello

    -has this been fixed ?  as i am getting the same error!

    thanks 

     

    nettiers nightly build 20070316

    codesmith version = 4.02  rev1774

    • Post Points: 35
  • 03-30-2007 5:29 AM In reply to

    • geochatz
    • Top 500 Contributor
    • Joined on 09-18-2006
    • Piraeus, Greece
    • Posts 13
    • Points 365

    Re: Problem with ntext

    No the bug is still there Sad
    Sex is like programming; one mistake and you must support it forever...
    • Post Points: 35
  • 04-12-2007 9:25 AM In reply to

    • altin
    • Top 150 Contributor
    • Joined on 10-19-2004
    • London, UK
    • Posts 35
    • Points 830

    Re: Problem with ntext

    This is the problem:

    In the latest version of TemplateLib/CommonSqlCode.cs we have:

      /// <summary>
      /// Determines whether base DataObjectBase is a string type, and not a blob column of text or ntext
      /// </summary>
      public bool CanCheckLength(SchemaExplorer.DataObjectBase column)
      {
       switch (column.DataType)
       {
        case DbType.AnsiString:
        case DbType.AnsiStringFixedLength:
        case DbType.String:
         return (column.Size != -1);
         break;

        case DbType.StringFixedLength:
         return
         (
          column.NativeType != "text" &&
          column.NativeType != "ntext" &&
          column.Size > 0
         );
         break;
        default:
          return false;
       }
      }

     

    This used to be:

      /// <summary>
      /// Determines whether base DataObjectBase is a string type, and not a blob column of text or ntext
      /// </summary>
      public bool CanCheckLength(SchemaExplorer.DataObjectBase column)
      {
       switch (column.DataType)
       {
        case DbType.AnsiString:
        case DbType.AnsiStringFixedLength:
        case DbType.String:
        case DbType.StringFixedLength:
         return
         (
          column.NativeType != "text" &&
          column.NativeType != "ntext" &&
          column.Size > 0
         );
         
        default:
          return false;
       }
      }

    However, ntext is of type DbType.String and have a 'field lenght' of 16...

    Filed under: ,
    • Post Points: 35
  • 04-12-2007 3:45 PM In reply to

    • Norsten
    • Top 500 Contributor
    • Joined on 02-19-2007
    • Posts 14
    • Points 275

    Re: Problem with ntext

    this bug has been reported http://tracker.nettiers.com/issue/ViewIssue.aspx?ID=163 but has not yet been resolved :(

    • Post Points: 5
Page 1 of 1 (7 items)
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems