﻿<?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 » Issues  » Business Object not recognizing type change</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 07:38:43 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8453.aspx</link><description>No problem :)&amp;nbsp; We do that all the time.&amp;nbsp; In fact, Steve and I were working on one yesterday and kept getting an error sayind that field such-and-such wasn't part of the table... ???&amp;nbsp; Well, as it turns out, we had&amp;nbsp;just that morning moved our connection string over to a different database that contained some test data.&amp;nbsp; Spent well over an hour stepping through the code thinking there was a bug :)</description><pubDate>Tue, 24 Apr 2007 09:06:28 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8276.aspx</link><description>I have a BO which has a date field.&amp;nbsp; Previously, it was a SmallDateTime field in the database.&amp;nbsp; I started getting an error when trying to put a value of 01/01/1800 in it for a null, so I changed the type to be a DateTime to make it accept the value.&amp;nbsp; I rebuilt the partial BO, and recompiled.&amp;nbsp; I am still getting an exception saying that there is a SmallDateTime overflow exception.&amp;nbsp;&amp;nbsp;I can put the 01/01/1800 date in if I do it directly through Query Analyzer, but when I do it through the BO it still thinks the field is a SmallDateTime for some reason.&amp;nbsp; It's like it isn't recognizing the type change, but all I see on the type in the BO code is System.DateTime.&amp;nbsp; Is there something I'm missing here or something I'm not doing?&lt;/P&gt;&lt;P&gt;The exception is coming from the SaveByForm routine in BusinessLayer.vb and it reads as follows:&amp;nbsp; SqlDbType.SmallDateTime overflow.&amp;nbsp; Value '01/01/1800 00:00:00' is out of range.&amp;nbsp; Must be between 1/1/1900 12:00:00 AM and 6/6/2079 11:59:59 PM.</description><pubDate>Tue, 24 Apr 2007 09:06:28 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8434.aspx</link><description>Ok, for some reason you made me think of what I was doing wrong here.&amp;nbsp; We have LOTS of databases that we use, and I was simply looking at the one I was running with and not the one I was mapping to.&amp;nbsp; I kept changing it in the one I was running with, so of course when I stepped through code it was changed.&amp;nbsp; But, the BO Mapper was still getting the SmallDateTime because I hadn't changed it in the mapped db.&amp;nbsp; Now I feel dumb...haha.&amp;nbsp; Sorry for the false alarm, but thanks for helping me through it.</description><pubDate>Mon, 23 Apr 2007 10:29:17 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8408.aspx</link><description>OK, I've been looking through the code that generates the partial classes for business objects, and the only SQL data type that uses SmallDateTime is SmallDateTime.&amp;nbsp; So, it could be that your business object is mapped in the BOMapper to a DDT profile rather than the actual SQL Server and the field is still SmallDateTime in the DDT.&amp;nbsp; Or vice versa, it's mapped to SQL Server and the actual field's data type wasn't changed.&amp;nbsp; If the actual source of the column is properly set to SmallDateTime, then there must be a problem with the GetSchema() method of the SQL Server connection returning the proper value.</description><pubDate>Mon, 23 Apr 2007 08:13:14 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8365.aspx</link><description>No, I changed it to a DateTime in the designer line but it changed back to a SmallDateTime when I rebuilt the partial.&amp;nbsp; For whatever reason it just won't let go of that original SmallDateTime type.&amp;nbsp; Let me know what you find out...hopefully I can get a fix for this so I can continue working on this piece of code.&amp;nbsp; Thanks for the help!</description><pubDate>Fri, 20 Apr 2007 09:53:53 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8334.aspx</link><description>[quote]I think this may be a bug because it should be changing that back to DateTime if I rebuild the partial shouldn't it?[/quote]&lt;/P&gt;&lt;P&gt;Hmmm...yes you are correct.&amp;nbsp; I will have to look into this.&amp;nbsp; If you remove that field descriptor class and rebuild the partial, does it show back up correctly?&amp;nbsp; Or, if you just change it to represent a DateTime and rebuild the partial does it leave it alone?&amp;nbsp; In either case, I am glad you found your problem.&amp;nbsp; I will look into this from a BO Mapper perspective.</description><pubDate>Thu, 19 Apr 2007 22:21:28 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8321.aspx</link><description>OK, I think I've found the issue.&amp;nbsp; In the designer code of the BO, inside the New()...there is a block of FieldNativeDbTypes.Add methods for each field.&amp;nbsp; The field in question still has this line of code:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;_FieldNativeDbTypes.Add(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"InsurerExpire"&lt;/FONT&gt;&lt;FONT size=2&gt;, System.Data.SqlDbType.SmallDateTime)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;I think this may be a bug because it should be changing that back to DateTime if I rebuild the partial shouldn't it?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Thu, 19 Apr 2007 15:41:38 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8320.aspx</link><description>Ok, I'm trying to step throught the code and figure out what's going on here.&amp;nbsp; I am seeing something that looks a little suspicious and mayb eyou can explain it.&amp;nbsp; In the DataLayer.vb code inside the BuildInsertInfo function I am&amp;nbsp;stepping through&amp;nbsp;where it is building the QueryInformation object.&amp;nbsp; There are a few lines towards the end that set some 'misc properties'.&amp;nbsp; One of these is loInfo.FieldNativeDbTypes = Me._BusinessObject.FieldNativeDbTypes.&amp;nbsp; When I inspect the contents of these, all of my fields that are normal DateTime types have a value of 4.&amp;nbsp; However, the field in question has a value of 15.&amp;nbsp; I am assuming this is a SmallDateTime.&amp;nbsp; Where is the business object getting these types from and could this somehow be affecting what's going on here?&lt;/P&gt;&lt;P&gt;Also...if this problem would be more quickly solved via a look at my computer, I can set that up if necessary.</description><pubDate>Thu, 19 Apr 2007 15:37:02 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8313.aspx</link><description>Have you built the framework in debug mode and see where the point of failure is through a debug session?&amp;nbsp; The BO really doesn't know about the SmallDateTIme.&amp;nbsp; So without being in your seat and performing a debug, there is no way for me to give you a direct answer here.</description><pubDate>Thu, 19 Apr 2007 14:44:20 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8311.aspx</link><description>Also, if this were a sql error wouldn't there be an entry in the sql&amp;nbsp;debug log?&amp;nbsp; In the sql log I have it doesn't have any sql for the event I'm getting the error message on.</description><pubDate>Thu, 19 Apr 2007 14:31:48 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8309.aspx</link><description>I did verify that the type was changed to a regular DateTime in Enterprise Manager.&amp;nbsp; I have also&amp;nbsp;been able to run a sql&amp;nbsp;update statement through&amp;nbsp;query analyzer&amp;nbsp;to set the date to be 01/01/1800 and it works correctly.&amp;nbsp; I didn't think the BO knew anything about SmallDateTime, but I'm just not sure where to look anymore.&amp;nbsp;</description><pubDate>Thu, 19 Apr 2007 14:27:07 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8303.aspx</link><description>Have you opened up the database with SQL Server Management Studio to see if the type was properly converted and saved?&amp;nbsp; The data type in the database would have to still be a SmallDateTime as the BO and DAL are ignorant to the SmallDateTime and use an internal DateTime for any date value.&amp;nbsp; So it would have to be on the SQL side.</description><pubDate>Thu, 19 Apr 2007 13:38:40 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8291.aspx</link><description>Yes, my app is setup to log sql for each time the application is run.&amp;nbsp; However, when I looked at it there was no SQL in the log for the time that the save operation was done...or for the time that the error occured.&amp;nbsp; It appears as though the error is before the SQL is even tried...</description><pubDate>Thu, 19 Apr 2007 11:56:09 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Business Object not recognizing type change</title><link>http://forum.strataframe.net/FindPost8281.aspx</link><description>Have you tried turing on the DAL debugger to see the update command?&amp;nbsp; In the AppMain you can set the debug mode for the data source:&lt;/P&gt;&lt;P&gt;[codesnippet]Databasics.DataSources(0).SetDebugOn("C:\MyDebug.html",True)[/codesnippet]&lt;/P&gt;&lt;P&gt;You can then review the debug information to see if there is anything that gives you a clue.&amp;nbsp; The error is more than likely coming from the SQL side rather than within the BO or DAL.</description><pubDate>Thu, 19 Apr 2007 10:28:29 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>