How to store more than 4k bytes of data in SQL CE 4?http://forums.asp.net/t/1592069.aspx/1?How+to+store+more+than+4k+bytes+of+data+in+SQL+CE+4+Fri, 20 Aug 2010 17:04:29 -040015920694035494http://forums.asp.net/p/1592069/4035494.aspx/1?How+to+store+more+than+4k+bytes+of+data+in+SQL+CE+4+How to store more than 4k bytes of data in SQL CE 4? <p>I need to store more than 4k of bytes in my SQLCE 4 database. How can I do that with the ASP.NET Web Pages 1.0?</p> <p>1: The Microsoft.Data provider fails when I try to populate a parameter with more than 4k bytes.<br> 2: Referencing SqlServerCe assembly and using SqlCeConnection/SqlCeCommand/SqlCeParameter throws exception: &nbsp;SQL Server Compact is not intended for ASP.NET development.</p> <p>How can I somehow map the generic DbType, which does not have NText as an option, to the ntext column in my database? (SqlCeParameter supports DbSqlType, which has ntext, but see problem #2)</p> 2010-08-19T09:31:05-04:004035677http://forums.asp.net/p/1592069/4035677.aspx/1?Re+How+to+store+more+than+4k+bytes+of+data+in+SQL+CE+4+Re: How to store more than 4k bytes of data in SQL CE 4? <p>You are referenceing the wrong version of System.data.SqlServerCe.dll. </p> <p>Browse to the one in:</p> <p>%ProgramFiles%\Microsoft SQL Server Compact Edition\v4.0\Desktop</p> <p>Then you can use ADO.NET.</p> 2010-08-19T11:05:50-04:004038128http://forums.asp.net/p/1592069/4038128.aspx/1?Re+How+to+store+more+than+4k+bytes+of+data+in+SQL+CE+4+Re: How to store more than 4k bytes of data in SQL CE 4? <p>Thank, that's helpful. For anyone else who need to use ntext on WebMatrix, you can use the following workaround:</p> <pre style="font-family:consolas"><span style="color:#2b91af">SqlCeParameter</span>&nbsp;contentParam&nbsp;=&nbsp;<span style="color:blue">new</span>&nbsp;<span style="color:#2b91af">SqlCeParameter</span>(<span style="color:#a31515">&quot;6&quot;</span>,&nbsp;System.Data.<span style="color:#2b91af">SqlDbType</span>.NText);<br>contentParam.Value&nbsp;=&nbsp;post.Content;<br>cmd.Parameters.Add(contentParam);</pre> <p>This is also described at the bottom of the beta readme:</p> <p><a href="http://learn.iis.net/page.aspx/872/webmatrix-beta-release-readme/">http://learn.iis.net/page.aspx/872/webmatrix-beta-release-readme/</a></p> <p>PS: The reason why I've been unable to make even the above code work, is that changing from nvarchar to ntext doesn't work, every time I change to next and hit save, it's just reverted back to nvarchar... I didn't notice that until I figured I had to verify it.</p> 2010-08-20T15:12:29-04:004038281http://forums.asp.net/p/1592069/4038281.aspx/1?Re+How+to+store+more+than+4k+bytes+of+data+in+SQL+CE+4+Re: How to store more than 4k bytes of data in SQL CE 4? <p>That seems to be a bug in the Table/Column Designer form. You need to ensure focus is on the top half when you hit save or Ctrl &#43; S (when you can ;o))</p> <p><br> </p> 2010-08-20T17:04:29-04:00