<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : ShouldTreatEmptyStringAsNull issue</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : ShouldTreatEmptyStringAsNull issue</description>
  <pubDate>Wed, 13 May 2026 18:18:02 -700</pubDate>
  <lastBuildDate>Mon, 24 Oct 2011 05:16:43 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2518</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>ShouldTreatEmptyStringAsNull issue :   Such a simple solution - I...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=11926#11926</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1120" rel="nofollow">scottarlp</a><br /><strong>Subject:</strong> 2518<br /><strong>Posted:</strong> 24-Oct-2011 at 5:16am<br /><br />Such a simple solution - I didn't look an an instance of the manager. That did exactly what I needed.<div>&nbsp;</div><div>Thanks!</div><div>Scott</div>]]>
   </description>
   <pubDate>Mon, 24 Oct 2011 05:16:43 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=11926#11926</guid>
  </item> 
  <item>
   <title>ShouldTreatEmptyStringAsNull issue : Hi Scott,The same approach used...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=11921#11921</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2518<br /><strong>Posted:</strong> 21-Oct-2011 at 11:37am<br /><br /><div>Hi Scott,</div><div><br></div>The same approach used server-side should work. The only difference is that you should refer to your Entity Manager instance instead:<br><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"><br></font></font><div><font>myEM.VerifierEngine.DefaultVerifierOptions.ShouldTreatEmptyStringAsNull = </font><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas">false</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">;</font></font><br><br></div><div>Regards,<br>   Silvio.</div>]]>
   </description>
   <pubDate>Fri, 21 Oct 2011 11:37:34 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=11921#11921</guid>
  </item> 
  <item>
   <title>ShouldTreatEmptyStringAsNull issue :   I have another issue with...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=11853#11853</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1120" rel="nofollow">scottarlp</a><br /><strong>Subject:</strong> 2518<br /><strong>Posted:</strong> 18-Oct-2011 at 7:39am<br /><br />I have another issue with the empty string problem with DevForce. I have previously used the above code to take care of the server side and it has worked great. Recently, I started using Verifiers on the client side to provide more custom logic. I also moved to WPF and started using the ValidatesOnDataErrors, which was great. <div>&nbsp;</div><div>However, the empty string issue has surfaced now on the client side. How do I either remove or change the client side verifier to allow empty string in a non-nullable field (which by my history of programming is valid)? I've tried adding a RequiredValueVerifier, setting the treatasnull to false and the string length one allowing minimum of zero and treatasnull to false (couldn't figure out how to set max length, so I set it to null). Neither of these appeared to change anything.</div><div>&nbsp;</div><div>So I think my question is how do I remove (or alter) the default required length &gt; 0 verifier from non nullable string fields during client side validation?</div><div>&nbsp;</div><div>Thanks for any help.</div><div>Scott</div>]]>
   </description>
   <pubDate>Tue, 18 Oct 2011 07:39:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=11853#11853</guid>
  </item> 
  <item>
   <title>ShouldTreatEmptyStringAsNull issue :   Thank you. That gave me enough...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=11185#11185</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1120" rel="nofollow">scottarlp</a><br /><strong>Subject:</strong> 2518<br /><strong>Posted:</strong> 06-Jul-2011 at 10:15am<br /><br />Thank you. That gave me enough to figure it out. It would help if IB would have some concrete examples of some of this. There's a lot of references to all the properties and overrides, but I couldn't figure out this simple code on piecing it all together. Just in case someone else needs to see the actual code to do this, I'm attaching below. I added a new class to my EDM project and the below code.<div>&nbsp;</div><div>using IdeaBlade.EntityModel.Server;</div><div>public class EntityServerSaveManager<br>: EntityServerSaveInterceptor<br>{<br>protected override bool ValidateSave()<br>{<br>EntityManager.VerifierEngine.DefaultVerifierOptions.ShouldTreatEmptyStringAsNull = false;<br>return base.ValidateSave();<br>}<br>}</div>]]>
   </description>
   <pubDate>Wed, 06 Jul 2011 10:15:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=11185#11185</guid>
  </item> 
  <item>
   <title>ShouldTreatEmptyStringAsNull issue :    Hi scottarlp,By SaveInterceptor...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=11184#11184</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2518<br /><strong>Posted:</strong> 06-Jul-2011 at 9:50am<br /><br />Hi scottarlp,<div>&nbsp;</div><div>By SaveInterceptor I mean&nbsp;a sub-class (server side)&nbsp;of EntityServerSaveInterceptor where you can override its virtual properties and methods. (i.e. ValidateSave method)</div><div>&nbsp;</div><div>You can find more information about save interceptors in the <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/save-lifecycle-server" target="_blank">DRC</a>.</div><div>&nbsp;</div><div>In the client you can simply use the one-liner snippet provided in my previous post. (be sure to replace&nbsp;'<font size="2" face="C&#111;nsolas">EntityManager</font>' with&nbsp;your EM&nbsp;instance)</div><div>&nbsp;</div><div>Regards,</div><div>&nbsp;&nbsp; Silvio.</div><span style="font-size:10px"><br /><br />Edited by sbelini - 06-Jul-2011 at 9:50am</span>]]>
   </description>
   <pubDate>Wed, 06 Jul 2011 09:50:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=11184#11184</guid>
  </item> 
  <item>
   <title>ShouldTreatEmptyStringAsNull issue :   I&amp;#039;m a little confused...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=11183#11183</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1120" rel="nofollow">scottarlp</a><br /><strong>Subject:</strong> 2518<br /><strong>Posted:</strong> 06-Jul-2011 at 9:29am<br /><br />I'm a little confused as to what and where exactly you perform these changes. I've read the following link and the surrounding ones several times and I can't tell if I need to add a class to my EF project or what. I simply want to turn off treating empty strings as nulls since they aren't to begin with.<div></div><div>Can you tell me exactly what and where I put code or set properties to change this?</div><div>&nbsp;</div><div>Thanks.</div><div>&nbsp;</div><div><a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/validati&#111;n-c&#111;nfigure" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/validation-configure</a></div><div>&nbsp;</div>]]>
   </description>
   <pubDate>Wed, 06 Jul 2011 09:29:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=11183#11183</guid>
  </item> 
  <item>
   <title>ShouldTreatEmptyStringAsNull issue : Hi Jignesh,  Sorry for the confusion. After...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=10035#10035</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2518<br /><strong>Posted:</strong> 22-Feb-2011 at 5:41pm<br /><br /><DIV>Hi Jignesh,</DIV><DIV>&nbsp;</DIV><DIV>Sorry for the confusion.</DIV><DIV>After some investigation and better understanding of your problem, I found out that the actual issue is that even though you set ShouldTreatEmptyStringAsNull = False in the client, you haven't done so in the Server.</DIV><DIV>&nbsp;</DIV><DIV>This is necessary because in your particular case you are setting the VerifierEngine "less strict" than it was originally. So, you most also "loose it up" in the server.</DIV><DIV>&nbsp;</DIV><DIV>You should do that in a SaveInterceptor, in the ValidateSave override: (have this in the very beginning)</DIV><DIV>&nbsp;</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>EntityManager.VerifierEngine.DefaultVerifierOptions.ShouldTreatEmptyStringAsNull = </FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas>false</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>;</FONT></FONT>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>In our DevForce Resource Center, you will find more information about <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/Server-side-validati&#111;n" target="_blank">Server-Side Validation</A> and <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/Server-Side-Life-Cycle-&#069;vents" target="_blank">Server-Side Life Cycle</A>.</DIV><DIV>&nbsp;</DIV><DIV>Regards,</DIV><DIV>&nbsp;&nbsp; Silvio.</DIV><span style="font-size:10px"><br /><br />Edited by sbelini - 22-Feb-2011 at 5:41pm</span>]]>
   </description>
   <pubDate>Tue, 22 Feb 2011 17:41:06 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=10035#10035</guid>
  </item> 
  <item>
   <title>ShouldTreatEmptyStringAsNull issue : Thanks for your reply. If I understand...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=10027#10027</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=957" rel="nofollow">hijaggu</a><br /><strong>Subject:</strong> 2518<br /><strong>Posted:</strong> 22-Feb-2011 at 9:19am<br /><br />Thanks for your reply. If I understand &nbsp;correctly, Buddy class means Metadata class?? If thats true, I already tried it. Challenge with buddy class is, I &nbsp;need to create buddy class for each entity and for each string property I need to specify verifier which would be very cumbersome. &nbsp;Is there a workaround which I can implement as global setting for each entity?<div><br></div><div><br></div><div>- Jignesh &nbsp;</div>]]>
   </description>
   <pubDate>Tue, 22 Feb 2011 09:19:55 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=10027#10027</guid>
  </item> 
  <item>
   <title>ShouldTreatEmptyStringAsNull issue : Hi Jignesh,  You coulduse a...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=10020#10020</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2518<br /><strong>Posted:</strong> 22-Feb-2011 at 1:03am<br /><br />Hi Jignesh,<DIV>&nbsp;</DIV><DIV>You could&nbsp;use a "buddy" class&nbsp;and create a verifier to override the&nbsp;verifier in the generated code.</DIV><DIV>&nbsp;</DIV><DIV>The "buddy" class is a new feature available in DevForce 6.0.8.</DIV><DIV>&nbsp;</DIV><DIV>You will find more information about in our <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/Adding-Validati&#111;n-Attributes-to-Generated-Properties" target="_blank">DevForce resource Center</A>.</DIV><DIV>&nbsp;</DIV><DIV>Silvio.</DIV>]]>
   </description>
   <pubDate>Tue, 22 Feb 2011 01:03:52 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=10020#10020</guid>
  </item> 
  <item>
   <title>ShouldTreatEmptyStringAsNull issue : Hi,  I believe we have found...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=9997#9997</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=957" rel="nofollow">hijaggu</a><br /><strong>Subject:</strong> 2518<br /><strong>Posted:</strong> 18-Feb-2011 at 6:43pm<br /><br /><div><font ="Apple-style-span" face="Helvetica, sans-serif" size="2" color="#333333"><span ="Apple-style-span" style="border-collapse: collapse; line-height: normal; -webkit-border-horiz&#111;ntal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><p ="Ms&#111;normal">Hi,</p><p ="Ms&#111;normal">I believe we have found an invalid EntityManagerSaveException.</p><p ="Ms&#111;normal">We have a Mssql data field (string) that is set to <u>not</u>allow NULL.&nbsp; However, an <u>empty</u>string is acceptable.</p><p ="Ms&#111;normal">We have changed the flag ShouldTreatEmptyStringAsNull tofalse in order to allow an empty value not cause a verification systemexception.&nbsp; This seems to work properly.&nbsp; However, the entity still has a propertyIsRequired=true in the autogenerated class and this causes an EntityManagerSaveExceptionto be thrown when saving the object (xyz property is required).&nbsp; &nbsp;&nbsp;Thisseems to be conflicting behavior. Would you please suggest how to handle this situation?&nbsp;</p><p ="Ms&#111;normal"><br></p><p ="Ms&#111;normal">- Jignesh Suthar&nbsp;</p></span></font></div>]]>
   </description>
   <pubDate>Fri, 18 Feb 2011 18:43:07 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2518&amp;PID=9997#9997</guid>
  </item> 
 </channel>
</rss>