﻿<?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?)  » BO Mapper DateTime C# Settings Issue</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 01:13:19 GMT</lastBuildDate><ttl>20</ttl><item><title>BO Mapper DateTime C# Settings Issue</title><link>http://forum.strataframe.net/FindPost28542.aspx</link><description>I have been using Strataframe/VB.NET for some time now.&amp;nbsp; But I have been ask to develop an C#/ASP.NET Web app.&amp;nbsp; So I am new to all that.&amp;nbsp; I am trying to setup my field settings in the BO Mapper where I am assigning for my date fields the value&amp;nbsp;of #1/1/1800# for Return Alternate on Null / Set Null on .... option.&amp;nbsp; C# code generated shows the compiler error 'Preprocesor directives must appear as the first non-whitespace character on a line.' for the following code:&lt;br/&gt;&lt;br/&gt;&lt;font color=#0000ff size=2&gt;&lt;font color=#0000ff size=2&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font color=#000000 size=2&gt; (&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&lt;font color=#0000ff size=2&gt;value&lt;/font&gt;&lt;/font&gt;&lt;font size=2&gt;&lt;font color=#000000&gt; != #1/1/1800#)&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;What is wrong?&amp;nbsp; Also, in addition to this, is there anything else I need to be aware of when using C# vs VB.NET is setting up the BO Mapper stuff?&lt;br/&gt;&lt;br/&gt;Thanks,&lt;br/&gt;&lt;br/&gt;Jeff</description><pubDate>Thu, 30 Sep 2010 19:41:12 GMT</pubDate><dc:creator>Jeff Pagley</dc:creator></item><item><title>RE: BO Mapper DateTime C# Settings Issue</title><link>http://forum.strataframe.net/FindPost28552.aspx</link><description>Glad it helped Jeff!&amp;nbsp; And I used the chart Ivan posted [b]a lot[/b] when I was learning C# after having programmed in VB.NET for a couple of years. </description><pubDate>Thu, 30 Sep 2010 19:41:12 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: BO Mapper DateTime C# Settings Issue</title><link>http://forum.strataframe.net/FindPost28551.aspx</link><description>That is great, Jeff. Hope it helps. ;)</description><pubDate>Thu, 30 Sep 2010 18:21:53 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: BO Mapper DateTime C# Settings Issue</title><link>http://forum.strataframe.net/FindPost28550.aspx</link><description>Your are welcome Jeff!</description><pubDate>Thu, 30 Sep 2010 16:15:12 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: BO Mapper DateTime C# Settings Issue</title><link>http://forum.strataframe.net/FindPost28549.aspx</link><description>Thanks Edhy/Greg that did the trick.&amp;nbsp; BTW Ivan the comparison chart is very helpful.&amp;nbsp; Thanks!</description><pubDate>Thu, 30 Sep 2010 14:18:22 GMT</pubDate><dc:creator>Jeff Pagley</dc:creator></item><item><title>RE: BO Mapper DateTime C# Settings Issue</title><link>http://forum.strataframe.net/FindPost28548.aspx</link><description>The primary concept to understand is that the BOMapper is going to put whatever you type into the replacement value directly into code. Thus it must be valid for the language being used by the BO.&amp;nbsp; VB.NET has the date literal (#1/1/1800#) but C# does not. I use the method Edhy suggested myself, though it has to be valid C# so it has to be:&lt;br/&gt;&lt;br/&gt;&lt;span&gt;[code]new DateTime(1800, 1, 1)[/code]&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;No semi-colon needed as it is inserted into lines of code, but the [b]new[/b] keyword is lower case in C#.</description><pubDate>Thu, 30 Sep 2010 11:58:35 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: BO Mapper DateTime C# Settings Issue</title><link>http://forum.strataframe.net/FindPost28544.aspx</link><description>I think you could also use DateTime.Parse("1/1/1800 00:00:00")&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Here is a good comparison chart that could be handy for you:&lt;br/&gt;&lt;br/&gt;&lt;a href="http://www.harding.edu/fmccown/vbnet_csharp_comparison.html"&gt;&lt;a href="http://www.harding.edu/fmccown/vbnet_csharp_comparison.html"&gt;http://www.harding.edu/fmccown/vbnet_csharp_comparison.html&lt;/a&gt;&lt;/a&gt;</description><pubDate>Thu, 30 Sep 2010 10:27:07 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: BO Mapper DateTime C# Settings Issue</title><link>http://forum.strataframe.net/FindPost28543.aspx</link><description>Hi Jeff,&lt;br/&gt;&lt;br/&gt;Instead of using a literal in the Return Alternate on Null, try something like this:&lt;br/&gt;&lt;span&gt;[quote]New DateTime(1800, 1, 1)[/quote]&lt;/span&gt;</description><pubDate>Thu, 30 Sep 2010 09:30:29 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>