>The textbox.text data originates in a vfp table. Debugging showed that although there were only 3 characters, the textbox thinks that the text contains 10 (the length of the VFP field), making it equal to the maxlength of textbox.
>
>I trimmed the textbox.text and the problem went away.Actually, the textbox doesn't think that the text contained 10 characters, it actually did contain 10 characters, 3 characters padded with 7 spaces. That's why the .Trim() took care of it.
This can also happen with SQL Server CHAR columns. A column defined as CHAR(10) will be padded with spaces to a total of 10 characters, whereas a column defined as VARCHAR(10) will not have the extra spaces. (I believe that that's with the default settings, which I *think* can be changed by SET ANSI PADDING ... I'm no SQL Server expert though ... I know enough to be dangerous. <g>)
~~Bonnie