Last post May 21, 2010 02:28 PM by pancakegeels
Mar 20, 2009 08:46 AM|csharp_starter|LINK
i used SqlDbtype.NVarchar as below to allow normal text string to be input to the textbox and save. On the other hand, i defined the data type as Nvarchar(MAX) and below i notice the SIZE specified -1,
I found out If i replace NVarchar with Varchar(MAX), and i will successfully edited if the line does not exist more than 1 line in the textbox,
Mar 20, 2009 10:20 AM|qwe123kids|LINK
Kindly Check in table..what Length Have u kept for that Filed..
Hope it helps
Mar 20, 2009 10:37 AM|l0n3i200n|LINK
Check the size allowed in the Database column in SQL. Varchar(max) if I can remember correctly allows 8000 chars.
Mar 20, 2009 11:04 AM|csharp_starter|LINK
i read the article on the link below, it enables maxlength in textbox once multilined with js, but still the text got truncated after next line
field.value = field.value.substring(0, maxlimit);
countfield.value = maxlimit - field.value.length;
Mar 25, 2009 10:35 AM|Jian Kang - MSFT|LINK
This issue is caused by we are trying to insert values in a column greater than the max size of the column specified.
I notice that the parameter’s length is 1000:
cmdSQL.Parameters.Add(new SqlParameter("@strDescription", SqlDbType.NVarChar, 1000));
nchar and nvarchar (Transact-SQL)
Mar 25, 2009 02:20 PM|Grady Christie|LINK
If you're certain that your data will remain intact you can insert this t-sql statement before you execute your query:
Hope it helps. Thanks, Grady Christie
May 21, 2010 02:28 PM|pancakegeels|LINK
Might be worth pointing out here, given it turned up when I was trying to solve this issue, if you are using a function you wrote, check what it returns.
I had a date, which could never be more than 10 characters, returning 50 chars. This slightly disguised the problem - hope this helps someone.