﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Handling varchar fields</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 17:01:03 GMT</lastBuildDate><ttl>20</ttl><item><title>Handling varchar fields</title><link>http://forum.strataframe.net/FindPost538.aspx</link><description>I have a database field SendMethod varchar(10).&lt;br&gt;
&lt;br&gt;
When I refer to this field after a Fill procedure, for example as:&lt;br&gt;
bo.SendField the contents is "FAX       " padded to a length of 10.&lt;br&gt;
I think that for a varchar(10) field, the contents should be "FAX" and for a char(10) the contents should be "FAX       ".&lt;br&gt;
&lt;br&gt;
If the current behavior is correct then I will have to Rtrim every reference to the field in the BO, which doesn't sound appealing.&lt;br&gt;
&lt;br&gt;</description><pubDate>Fri, 10 Feb 2006 18:59:45 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: Handling varchar fields</title><link>http://forum.strataframe.net/FindPost541.aspx</link><description>From the InnerException:&lt;br&gt;
StackTrace = "   at MicroFour.StrataFrame.Business.BusinessLayer.SaveBase(Boolean Transactional, String TransactionKey)\r   at MicroFour.StrataFrame.Business.BusinessLayer.Save(Boolean Transactional)\r   at TEST_FaxSending.Form1.timer_Tick(Object sender, EventArgs e...&lt;br&gt;
&lt;br&gt;
It looks like maybe the BusinessLayer.SaveBase is requiring a key name even though Save() and Save(false) imply that the save is not part of a transaction&lt;br&gt;
???</description><pubDate>Fri, 10 Feb 2006 18:59:45 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: Handling varchar fields</title><link>http://forum.strataframe.net/FindPost540.aspx</link><description>You're right. That was an artifact of converting from char to varchar.&lt;br&gt;
&lt;br&gt;
I've now gotten to the point of trying to save and update to a Log record. When I execute _Log.Save() I get:&lt;br&gt;
Value cannot be null.&lt;br&gt;
Parameter name: key&lt;br&gt;
System.ArgumentNullException: Value cannot be null.&lt;br&gt;
Parameter name: key&lt;br&gt;
   at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)&lt;br&gt;
   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)&lt;br&gt;
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)&lt;br&gt;
   at MicroFour.StrataFrame.Data.SqlDataSourceItem.CreateDbParameter(QueryInformation QueryInfo, String FieldName)&lt;br&gt;
   at MicroFour.StrataFrame.Data.SqlDataSourceItem.BuildUpdateCommand_NonSP(QueryInformation QueryInfo)&lt;br&gt;
   at MicroFour.StrataFrame.Data.SqlDataSourceItem.BuildUpdateCommand(QueryInformation QueryInfo)&lt;br&gt;
   at MicroFour.StrataFrame.Data.SqlDataSourceItem.UpdateRow(QueryInformation QueryInfo, DataRow RowToUpdate, ConcurrencyExceptionHandler ConcurrencyHandler)&lt;br&gt;
   at MicroFour.StrataFrame.Data.DataLayer.UpdateDataTableThread(Object ThreadParams)</description><pubDate>Fri, 10 Feb 2006 18:54:36 GMT</pubDate><dc:creator>Daniel Essin</dc:creator></item><item><title>RE: Handling varchar fields</title><link>http://forum.strataframe.net/FindPost539.aspx</link><description>Daniel,&lt;/P&gt;&lt;P&gt;I am not sure exactly what you are trying to say.&amp;nbsp; If you have a field typed as a VarChar(x), and you store a value of "FAX", it will only store and retrieve "FAX"&amp;nbsp; however, if you are using a char(x) type, if you store a value of "FAX" SQL Server will return a value of "FAX&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;".&amp;nbsp; StrataFrame BOs will retrieve the value as it is stored in the database.&amp;nbsp; If you have a VarChar(x) field that has padding on the right, it had to be stored that way.&amp;nbsp; If you store a padded value into a VarChar field, it will respect that padding and keep it in the database.&amp;nbsp;</description><pubDate>Fri, 10 Feb 2006 16:57:29 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>