All related subjects I saw in this site discuss stored procedures and alike. I have a C# program that receives a string (not important from where, maybe file or uploaded) and tries to insert it into a varchar(MAX)
column. My code is like this:
command.Parameters.AddWithValue("@pxslt", mer.XsltTemplate);
It raised an error:
String or binary data would be truncated.
I changed it to:
command.Parameters.Add("@pxslt", SqlDbType.).Value = mer.XsltTemplate;
but still it raises the same error.
What is the solution? The size of my string is about 8100 characters.