Assuming that strContentText is a TEXT (or NTEXT) column then you have
not declared your Property attribute correctly.

http://castleproject.org/index.php/ActiveRecord:Troubleshooting#Text_Columns_are_truncated_in_Sql_Server


On 6/7/06, Ed Wake <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
> Hi All,
>
>
>
> Every time I execute an update / save text is cut off at approx 4000 chars.
> A standard SQL insert works fine (I've a problem with the update so I
> thought I'd see if activeRecord could handle it)
>
>
>  Any ideas why this would happen?
>
>  Class
>
>  Imports Castle.ActiveRecord
>
> Imports Castle.ActiveRecord.Queries
>
>
>
> <ActiveRecord("t_content")> _
>
> Public Class nContent
>
>     Inherits ActiveRecordBase
>
>
>
>     Private _strContentName As String
>
>     Private _strContentText As String
>
>     Private _intContentID As Integer
>
>
>
>     <PrimaryKey(PrimaryKeyType.Native, "intContentID")> _
>
>     Public Property id() As Integer
>
>         Get
>
>             Return Me._intContentID
>
>         End Get
>
>         Set(ByVal value As Integer)
>
>             Me._intContentID = value
>
>         End Set
>
>     End Property
>
>     <[Property](Column:="strContentName")> _
>
>     Public Property name() As String
>
>         Get
>
>             Return Me._strContentName
>
>         End Get
>
>         Set(ByVal value As String)
>
>             Me._strContentName = value
>
>         End Set
>
>     End Property
>
>     'in the db this field is nText
>
>     <[Property](Column:="strContentText")> _
>
>     Public Property text() As String
>
>         Get
>
>             Return Me._strContentText
>
>         End Get
>
>         Set(ByVal value As String)
>
>             Me._strContentText = value
>
>         End Set
>
>     End Property
>
>
>
>
>
>     Public Shared Function Find(ByVal id As Integer) As nContent
>
>         Return
> CType(ActiveRecordBase.FindByPrimaryKey(GetType(nContent),
> id), nContent)
>
>     End Function
>
>
>
> End Class
>
>
>  useage:
>
>
>
> 'add
>
>
>
>
> Castle.ActiveRecord.ActiveRecordStarter.Initialize(New
> Castle.ActiveRecord.Framework.Config.XmlConfigurationSource(System.Web.HttpContext.Current.Server.MapPath("appconfig.xml")),
> GetType(nLibrary.nContent))
>
>                 Dim _nContent As New nLibrary.nContent
>
>
>
>                 _nContent.name = txtName.Text
>
>                 _nContent.text = rchContent.Text 'richtextbox
>
>                 _nContent.Save()
>
>
>
> 'update
>
> Castle.ActiveRecord.ActiveRecordStarter.Initialize(New
> Castle.ActiveRecord.Framework.Config.XmlConfigurationSource(System.Web.HttpContext.Current.Server.MapPath("appconfig.xml")),
> GetType(nLibrary.nContent))
>
>                 Dim _nContent As New nLibrary.nContent
>
>
>
>                 _nContent = nLibrary.nContent.Find(Request("intContentID"))
>
>                 _nContent.name = txtName.Text
>
>                 _nContent.text = rchContent.Text 'richtextbox
>
>                 _nContent.Update()
>
>
>
>
>
>
>
> Cheers
>
> Ed Wake
>
>  Remote New Media
>  t:01588 680480
>
> w:www.remotenewmedia.co.uk
>
> e:[EMAIL PROTECTED]
>
>
>
>
> _______________________________________________
> CastleProject-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/castleproject-users
>
>
>


_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users

Reply via email to