StrataFrame Forum

Field Space Padding

http://forum.strataframe.net/Topic12926.aspx

By Fred Seider - 12/6/2007

I can't seem to eliminate trailing spaces being padded onto my bound text boxes.  The data type is nvarchar(50), and I always end up with spaces padded after my field data, up to a total of 50.  Even after I Edit the field, remove the spaces, and save it.  If I open the dialog again, and go to edit the field, I have the space padding again!  If I go into the datbase directly, I see the field data truly is padded.   I looked at the sample apps, and it looks like I'm set up the same way, but no doubt I am missing something here.

Thanks in advance for any assistence!

By StrataFrame Team - 12/7/2007

Well, it might be that the column was originally nchar(50), and when you changed it to nvarchar(50), it didn't get changed.  There isn't anything in the business object that would add trailing spaces to pad the field.  Most likely, it's something in the database column. 

To make sure that it's the database, you can turn on debug mode for the data source (search this forum for SetDebugOn and you'll find several samples on how to do that), then look at the debug file for the UPDATE call.  The parameters will be listed and you should be able to tell whether the value is padding while being saved.  If the value in the debug file is correct, then you've got something in your database that is doing it.

By StrataFrame Team - 12/7/2007

If you're running it through a stored procedure or anything, if the parameter is nchar(50) or char(50), it will pad it when passing it through the parameter.
By Fred Seider - 12/9/2007

Ah! I think that's the problem.  Thanks!