title: How do i output more text?
body: <p>I am working on a homemade forum for an exam and i have just discovered a wierd problem. 
  If i input more than 50 characters into the textarea made for post content, the data is commited to the database but when i try to show the post, my post object fails due to a constraint exception.</p>
  
  <p>anybody know what might be causing this?</p>
  
  <p>the field in the database is of the type text.</p>
  
  <pre><code>Line 139:            DataTable daldata = dalPosts.GetDataFirstPostInThreadId(id);
  Line 140:
  Line 141:            Post postObject = new Post(Convert.ToInt32(daldata.Rows[0]["id"]), Convert.ToInt32(daldata.Rows[0]["fk_user_id"]), Convert.ToInt32(daldata.Rows[0]["fk_thread_id"]), daldata.Rows[0]["contents"].ToString(), Convert.ToDateTime(daldata.Rows[0]["submissiondate"]), Convert.ToBoolean(daldata.Rows[0]["isdeleted"]));
  Line 142:            return postObject;
  Line 143:
  </code></pre>
  
  <p>error details:</p>
  
  <pre><code>System.Data.ConstraintException was unhandled by user code
    Message=Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
    Source=System.Data
    StackTrace:
         at System.Data.DataTable.EnableConstraints()
         at System.Data.DataTable.set_EnforceConstraints(Boolean value)
         at System.Data.DataTable.EndLoadData()
         at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
         at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
         at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
         at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
         at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
         at DALTableAdapters.PostTableAdapter.GetDataFirstPostInThreadId(Int32 threadid) in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\bp2010\62c352df\ee467897\App_Code.rvxbfwcl.5.cs:line 7570
         at DataBLL.PostBLL.ObjectFirstInThread(Int32 id) in c:\Users\Stjerneklar\Documents\My Dropbox\SP2010 Ballonparken\BP2010\App_Code\DataBLL\PostBLL.cs:line 139
         at DataBLL.Thread..ctor(String name, Int32 id, Int32 fk_category_id) in c:\Users\Stjerneklar\Documents\My Dropbox\SP2010 Ballonparken\BP2010\App_Code\DataBLL\ThreadBLL.cs:line 67
         at DataBLL.threadBLL.SelectByCategoryId(Int32 fk_category_id) in c:\Users\Stjerneklar\Documents\My Dropbox\SP2010 Ballonparken\BP2010\App_Code\DataBLL\ThreadBLL.cs:line 176
         at ForumThreads.createThread(Object sender, EventArgs e) in c:\Users\Stjerneklar\Documents\My Dropbox\SP2010 Ballonparken\BP2010\ForumThreads.aspx.cs:line 49
         at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
         at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
         at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
         at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
         at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
         at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    InnerException: 
  </code></pre>
  
  <p>I have no other content in the related tables that might affect things, and if i shorten the text everything works fine.</p>
  
  <p>Edit: 
  Figured it out in the end(the night before handing in the assignment)
  the offending field was defined as having a maxlenght of 50 chars in my dataset.</p>