Business Object not recognizing type change


Author
Message
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Have you opened up the database with SQL Server Management Studio to see if the type was properly converted and saved?  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.  So it would have to be on the SQL side.
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Yes, my app is setup to log sql for each time the application is run.  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.  It appears as though the error is before the SQL is even tried...
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Have you tried turing on the DAL debugger to see the update command?  In the AppMain you can set the debug mode for the data source:

Databasics.DataSources(0).SetDebugOn("C:\MyDebug.html",True)

You can then review the debug information to see if there is anything that gives you a clue.  The error is more than likely coming from the SQL side rather than within the BO or DAL.

Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have a BO which has a date field.  Previously, it was a SmallDateTime field in the database.  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.  I rebuilt the partial BO, and recompiled.  I am still getting an exception saying that there is a SmallDateTime overflow exception.  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.  It's like it isn't recognizing the type change, but all I see on the type in the BO code is System.DateTime.  Is there something I'm missing here or something I'm not doing?

The exception is coming from the SaveByForm routine in BusinessLayer.vb and it reads as follows:  SqlDbType.SmallDateTime overflow.  Value '01/01/1800 00:00:00' is out of range.  Must be between 1/1/1900 12:00:00 AM and 6/6/2079 11:59:59 PM.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search