I'd suggest specifying the length of the field when creating the parameter:
var paramData = command.Parameters.Add("@StorageData", System.Data.SqlDbType.NText, /* column length here */);
paramData.Value = content;
I'd suggest specifying the length of the field when creating the parameter:
var paramData = command.Parameters.Add("@StorageData", System.Data.SqlDbType.NText, /* column length here */);
paramData.Value = content;
Maybe you should think about why do you have to put such large amounts of text into a database. Maybe a reference (link - path) to an external file would be a better solution.
Hi,
I if you can change the type of StorageData
from ntext
to image
and write your content as Binary. I guess that would help you.
Cheers AK
Have you read the docs for ntext data type?
Variable-length Unicode data with a maximum length of 230 - 1 (1,073,741,823) characters. Storage size, in bytes, is two times the number of characters entered
Is your very large content greater in size than the maximum? If so you're out of luck - you need a data type which can store more data than ntext. My suggestion: varbinary(MAX) or Image.