Cannot insert into DB

Topics: Administration, Core, Customizing Orchard, Installing Orchard, Writing modules
Mar 11, 2015 at 4:18 PM
The previous length of the Table field in the Database was 200 char. Then I increased it to MAX and then in the cshtml page I have set the maxlength to 2000. When I am trying to insert, it is giving me this error:
"String or binary data would be truncated.\r\nThe statement has been terminated."
But when I change the maxlength to 200 from cshtml page then it is getting inserted. Please help!
Developer
Mar 11, 2015 at 7:26 PM
Both the column should be Unlimited() and the property should have the StringLengthMax attribute.
Mar 12, 2015 at 5:50 AM
I have altered the column in migration with Unlimited(). The Column in the DB is also changed to MAX. And I have set the maxlength for the textbox in the cshtml page to 2000. But still it is not getting inserted. As mentioned earlier, when I change the maxlength to 200 then I am not getting any error and the value is getting inserted in the DB smoothly. But I want my textbox maxlength to be 2000. Please help!
Developer
Mar 12, 2015 at 8:07 AM
Edited Mar 12, 2015 at 8:08 AM
Make sure to delete the mappings.bin file, it contains the NHibernate mapping configuration. It will be regenerated when missing.
Mar 12, 2015 at 9:22 AM
It is still not working
Developer
Mar 12, 2015 at 10:36 AM
The record's property should have the StringLengthMax attribute.
Mar 12, 2015 at 10:44 AM
Not Working