Question : Visual Studio update error "String Truncation"

I have prepared a Windows Mobile 5 VB app with Visual Studio 2005 with SQL CE. Occasionally when I update data entry to the SQL table with the following: Me.InventoryTransferTableAdapter.Update(Me.InventoryTransDataSet.InventoryTransfer)
I get the following error "@p5:String Truncation: max=14, len=15, value='IN-2"DUALPRTTHR
The referenced field is an inventory item number field that is type nchar with a length of 30. I can't determine where the max=14 is coming from.
Thank you in advance for your very appreciated assistance

Answer : Visual Studio update error "String Truncation"

Actually, nchar means that the field will only accept that many characters, so the values MUST be padded, nad the software does not do the padding by itself.  On the other hand, nvarchar means that the field can accept UP TO that many characters, the actual space used is determined with the value is stored, and only the actual number of characters to be stored is what is actually used in the table.  I almost NEVER use nchar(unless I know, for a fact, that the values passed will ALWAYS be of a fixed length), and ALWAYS use varchar or nvarchar.

AW
Random Solutions  
 
programming4us programming4us