TextAreaFor with new lines throws an inner exception

It might be easy, but .....

I have a view that includes a text area: @Html.TextAreaFor(model => model.ContactInfo)

Without any new lines or with help, @Html.EditorFor

everything works smoothly. When I type in an address like ...

 John Doe
 1 Right Way
 New York, NY


... the following inner exception is thrown:

"String or binary data would be truncated.\r\nThe statement has been terminated."

How do I solve this?


source to share

1 answer

Kurt hit a nail on the head. I only hadvarchar(10)

in this field. Stupid me.

Lesson learned: "See what a particular field can do before jumping to conclusions."



All Articles