StrataFrame Forum

Business Object Mapper and Numeric field type (9,2)

http://forum.strataframe.net/Topic82.aspx

By Scott - 11/22/2005

When using the business object mapper and setting the business object properties using SQL Server as the data source the table fields are not mapped\added.  There are two fields in the table that are of type numeric 9,2.

If I use the Database Development Toolkit it will map the fields.  When using the business object there is a "Specified cast is not valid" message for the numeric fields.

I know I should use a currency field, and I will be changing this.  I just wanted to point this out incase it is an issues that needs to be looked into.

By StrataFrame Team - 11/22/2005

So, the SQL Server database has a field type of Decimal(9,2)?



Are you getting this error message at runtime, or when the Business Object Mapper is generating the partial class?



What I mean is, does the Business Object Mapper properly create the partial and then you get the error when you access the field, or do you get the error message when you choose "Rebuild Partial" within the Business Object Mapper?
By Trent L. Taylor - 11/22/2005

Scott,

Thanks for the tip.  This has been fixed and was actually caused by .NET excluding the Numeric data type from the SqlDbType enumeration.  I suppose they don't want us using the numeric type anymore.  At any rate, this has been fixed in the update that is now available through the downloads. 

By Ivan George Borges - 9/22/2006

Hya.

No need to look at this now. Just to say I'm facing this "Decimal" data type problem, at run time.

By StrataFrame Team - 9/26/2006

Thanks for the heads up, Ivan... I'll take a look at it.
By Keith Chisarik - 11/7/2006

As am I
By Keith Chisarik - 11/7/2006

I am getting errors trying to save values to a decimal(6,2) field.



I tried changing the type to money, BO Mapper still shows it as decimal.



What do we use for numeric fields?
By Keith Chisarik - 11/7/2006

nevermind......I had one field set to scale of zero. my bad.
By Trent L. Taylor - 11/7/2006

That's good because I could not figure out what was going on here...I will get out of my test now Smile
By Keith Chisarik - 11/7/2006

actually it was another developer here I was helping.... I would never make such an error Whistling
By Trent L. Taylor - 11/7/2006

Yeah...same thing here BigGrin  every bug that we have ever had...Ben's fault Laugh
By Ivan George Borges - 11/7/2006

I knew it!

(I bet he is not at the office)

By Trent L. Taylor - 11/7/2006

Hehe not today!!! So I can "tell the truth" BigGrin